xfs
[Top] [All Lists]

Re: [PATCH] 2.4.19-xfs EFSCORRUPTED redefine to EIO

To: Chris Wedgwood <cw@xxxxxxxx>
Subject: Re: [PATCH] 2.4.19-xfs EFSCORRUPTED redefine to EIO
From: Steve Lord <lord@xxxxxxx>
Date: 19 Sep 2002 14:02:10 -0500
Cc: linux-xfs@xxxxxxxxxxx
In-reply-to: <20020919185649.GA32227@tapu.f00f.org>
References: <20020919185649.GA32227@tapu.f00f.org>
Sender: linux-xfs-bounce@xxxxxxxxxxx
On Thu, 2002-09-19 at 13:56, Chris Wedgwood wrote:
> For corrupted filesystem right now, XFS can return EFSCORRUPTED
> (presently set to 990) to userspace.
> 
> This is pointless as (almost) no user-space code knows that this mean,
> it's inherently not portable, and rather ugly not to mention
> completely unmanageable if every filesystem and/or driver decides to
> invent their own error codes.
> 
> I suggest this trivial patch (2.4.x tree) to redefine it as EIO.
> Obviously, a similar fix should also go into 2.5.x.


Except that the filesystem internally needs to be able to tell the
difference between the two. There are actions taken upon EFSCORRUPTED
which we may not want to take on EIO. Having said that in most cases
where we get EIO from underneath we would probably map it to 
EFSCORRUPTED anyway.

So, I think this would need some major auditing before putting it in,
we reference EFSCORRUPTED in about 100 places.

Steve

> 
> 
>   --cw
> 
> 
> 
> 
> 
> diff -u -u -r1.84 xfs_linux.h
> --- fs/xfs/linux/xfs_linux.h  2002/09/05 05:37:11     1.84
> +++ fs/xfs/linux/xfs_linux.h  2002/09/19 18:42:21
> @@ -133,17 +133,11 @@
>  #define EWRONGFS     EINVAL          /* Mount with wrong filesystem type */
>  
>  /*
> - * XXX EFSCORRUPTED needs a real value in errno.h. asm-i386/errno.h won't
> - *     return codes out of its known range in errno.
> - * XXX Also note: needs to be < 1000 and fairly unique on Linux (mustn't
> - *     conflict with any code we use already or any code a driver may use)
> - * XXX Some options (currently we do #2):
> - *   1/ New error code ["Filesystem is corrupted", _after_ glibc updated]
> - *   2/ 990 ["Unknown error 990"]
> - *   3/ EUCLEAN ["Structure needs cleaning"]
> - *   4/ Convert EFSCORRUPTED to EIO [just prior to return into userspace]
> + * EFSCORRUPTED previously returned 990 which is a rather meaningless
> + * error code. Rather than invent new error codes every picosecond or
> + * so, lets just pick something appropriate and stick with it.
>   */
> -#define EFSCORRUPTED 990             /* Filesystem is corrupted */
> +#define EFSCORRUPTED EIO             /* Filesystem is corrupted */
>  
>  #define SYNCHRONIZE()        barrier()
>  #define lbolt                jiffies
> 
-- 

Steve Lord                                      voice: +1-651-683-3511
Principal Engineer, Filesystem Software         email: lord@xxxxxxx


<Prev in Thread] Current Thread [Next in Thread>