Re: [PATCH -v2 1/2] ext4: save the error code which triggered an ext4_error() in the superblock

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, Dec 13, 2019 at 12:29:10PM +0100, Jan Kara wrote:
> On Tue 03-12-19 22:23:34, Theodore Ts'o wrote:
> > This allows the cause of an ext4_error() report to be categorized
> > based on whether it was triggered due to an I/O error, or an memory
> > allocation error, or other possible causes.  Most errors are caused by
> > a detected file system inconsistency, so the default code stored in
> > the superblock will be EXT4_ERR_EFSCORRUPTED.
> > 
> > Previous-Version-Link: https://lore.kernel.org/r/20191121183036.29385-1-tytso@xxxxxxx
> > Signed-off-by: Theodore Ts'o <tytso@xxxxxxx>
> 
> Somewhat late to the party but: Seeing that you basically call
> ext4_set_errno() before every ext4_error() call (or its variants), won't it
> be more concise and less error proned to add errno as an argument to
> ext4_error() and handle setting from there? Or are there times where you
> don't want error set?

There are about 100 calls to ext4_error or its variants in fs/ext4.
This patch inserts ext4_set_errno() before roughly 20 of them.  Most
of the time, we call ext4_error() because we've found a file system
inconsistency.  So the default if ext4_set_errno() hasn't been called
is EXT4_ERR_EFSCORRUPTED.

I thought about adding errno as an argument to ext4_error(), but it
would have substantially increased the size of the patch.

Cheers,

						- Ted



[Index of Archives]     [Reiser Filesystem Development]     [Ceph FS]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Linux FS]     [Yosemite National Park]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Device Mapper]     [Linux Media]

  Powered by Linux