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.
--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
|