linux/fs/ext2
Bryan Donlan 4d6c13f87d ext2: return -EIO not -ESTALE on directory traversal through deleted inode
ext2_iget() returns -ESTALE if invoked on a deleted inode, in order to
report errors to NFS properly.  However, in ext[234]_lookup(), this
-ESTALE can be propagated to userspace if the filesystem is corrupted such
that a directory entry references a deleted inode.  This leads to a
misleading error message - "Stale NFS file handle" - and confusion on the
part of the admin.

The bug can be easily reproduced by creating a new filesystem, making a
link to an unused inode using debugfs, then mounting and attempting to ls
-l said link.

This patch thus changes ext2_lookup to return -EIO if it receives -ESTALE
from ext2_iget(), as ext2 does for other filesystem metadata corruption;
and also invokes the appropriate ext*_error functions when this case is
detected.

Signed-off-by: Bryan Donlan <bdonlan@gmail.com>
Cc: <linux-ext4@vger.kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2009-06-30 18:56:00 -07:00
..
acl.c helpers for acl caching + switch to those 2009-06-24 08:17:07 -04:00
acl.h switch ext2 to inode->i_acl 2009-06-24 08:15:28 -04:00
balloc.c ext2: Use lowercase names of quota functions 2009-03-26 02:18:36 +01:00
dir.c ext2: Do not update mtime of a moved directory 2009-06-18 13:03:44 -07:00
ext2.h switch ext2 to inode->i_acl 2009-06-24 08:15:28 -04:00
file.c switch ext2 to simple_fsync() 2009-06-11 21:36:12 -04:00
ialloc.c ext2: Use lowercase names of quota functions 2009-03-26 02:18:36 +01:00
inode.c switch ext2 to inode->i_acl 2009-06-24 08:15:28 -04:00
ioctl.c ext2: tighten restrictions on inode flags 2009-01-08 08:31:00 -08:00
Kconfig fs/Kconfig: move ext2, ext3, ext4, JBD, JBD2 out 2008-10-20 11:43:59 -07:00
Makefile switch ext2 to simple_fsync() 2009-06-11 21:36:12 -04:00
namei.c ext2: return -EIO not -ESTALE on directory traversal through deleted inode 2009-06-30 18:56:00 -07:00
super.c switch ext2 to inode->i_acl 2009-06-24 08:15:28 -04:00
symlink.c [PATCH] mark struct inode_operations const 1 2007-02-12 09:48:46 -08:00
xattr_security.c ext2: remove double definitions of xattr macros 2008-07-25 10:53:31 -07:00
xattr_trusted.c ext2: remove double definitions of xattr macros 2008-07-25 10:53:31 -07:00
xattr_user.c ext2: remove double definitions of xattr macros 2008-07-25 10:53:31 -07:00
xattr.c ext2: Use lowercase names of quota functions 2009-03-26 02:18:36 +01:00
xattr.h
xip.c [PATCH] move block_device_operations to blkdev.h 2008-10-21 07:47:20 -04:00
xip.h xip: support non-struct page backed memory 2008-04-28 08:58:23 -07:00