Revision 4d6c13f87db12ae1ce35ea6a15688ac72419b133 authored by Bryan Donlan on 30 June 2009, 18:41:24 UTC, committed by Linus Torvalds on 01 July 2009, 01:56:00 UTC
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>
1 parent 341c87b
History
File Mode Size
9p
adfs
affs
afs
autofs
autofs4
befs
bfs
btrfs
cachefiles
cifs
coda
configfs
cramfs
debugfs
devpts
dlm
ecryptfs
efs
exofs
exportfs
ext2
ext3
ext4
fat
freevxfs
fscache
fuse
gfs2
hfs
hfsplus
hostfs
hpfs
hppfs
hugetlbfs
isofs
jbd
jbd2
jffs2
jfs
lockd
minix
ncpfs
nfs
nfs_common
nfsd
nilfs2
nls
notify
ntfs
ocfs2
omfs
openpromfs
partitions
proc
qnx4
quota
ramfs
reiserfs
romfs
smbfs
squashfs
sysfs
sysv
ubifs
udf
ufs
xfs
Kconfig -rw-r--r-- 6.5 KB
Kconfig.binfmt -rw-r--r-- 6.4 KB
Makefile -rw-r--r-- 4.0 KB
aio.c -rw-r--r-- 46.3 KB
anon_inodes.c -rw-r--r-- 5.3 KB
attr.c -rw-r--r-- 4.8 KB
bad_inode.c -rw-r--r-- 7.9 KB
binfmt_aout.c -rw-r--r-- 12.8 KB
binfmt_elf.c -rw-r--r-- 54.2 KB
binfmt_elf_fdpic.c -rw-r--r-- 47.7 KB
binfmt_em86.c -rw-r--r-- 2.8 KB
binfmt_flat.c -rw-r--r-- 26.8 KB
binfmt_misc.c -rw-r--r-- 15.1 KB
binfmt_script.c -rw-r--r-- 2.8 KB
binfmt_som.c -rw-r--r-- 7.4 KB
bio-integrity.c -rw-r--r-- 19.1 KB
bio.c -rw-r--r-- 38.9 KB
block_dev.c -rw-r--r-- 36.9 KB
buffer.c -rw-r--r-- 88.8 KB
char_dev.c -rw-r--r-- 13.4 KB
compat.c -rw-r--r-- 55.8 KB
compat_binfmt_elf.c -rw-r--r-- 3.4 KB
compat_ioctl.c -rw-r--r-- 81.7 KB
dcache.c -rw-r--r-- 59.0 KB
dcookies.c -rw-r--r-- 6.8 KB
direct-io.c -rw-r--r-- 34.4 KB
drop_caches.c -rw-r--r-- 1.6 KB
eventfd.c -rw-r--r-- 8.1 KB
eventpoll.c -rw-r--r-- 38.9 KB
exec.c -rw-r--r-- 42.8 KB
fcntl.c -rw-r--r-- 14.0 KB
fifo.c -rw-r--r-- 3.2 KB
file.c -rw-r--r-- 12.1 KB
file_table.c -rw-r--r-- 11.1 KB
filesystems.c -rw-r--r-- 6.3 KB
fs-writeback.c -rw-r--r-- 22.0 KB
fs_struct.c -rw-r--r-- 3.3 KB
generic_acl.c -rw-r--r-- 4.2 KB
inode.c -rw-r--r-- 41.4 KB
internal.h -rw-r--r-- 1.9 KB
ioctl.c -rw-r--r-- 15.8 KB
ioprio.c -rw-r--r-- 5.2 KB
libfs.c -rw-r--r-- 21.4 KB
locks.c -rw-r--r-- 57.7 KB
mbcache.c -rw-r--r-- 18.3 KB
mpage.c -rw-r--r-- 20.0 KB
namei.c -rw-r--r-- 70.8 KB
namespace.c -rw-r--r-- 56.9 KB
nfsctl.c -rw-r--r-- 2.5 KB
no-block.c -rw-r--r-- 663 bytes
open.c -rw-r--r-- 27.0 KB
pipe.c -rw-r--r-- 25.1 KB
pnode.c -rw-r--r-- 8.9 KB
pnode.h -rw-r--r-- 1.1 KB
posix_acl.c -rw-r--r-- 8.4 KB
read_write.c -rw-r--r-- 20.0 KB
read_write.h -rw-r--r-- 542 bytes
readdir.c -rw-r--r-- 6.9 KB
select.c -rw-r--r-- 23.7 KB
seq_file.c -rw-r--r-- 14.8 KB
signalfd.c -rw-r--r-- 7.1 KB
splice.c -rw-r--r-- 46.1 KB
stack.c -rw-r--r-- 1.1 KB
stat.c -rw-r--r-- 10.2 KB
super.c -rw-r--r-- 22.2 KB
sync.c -rw-r--r-- 10.9 KB
timerfd.c -rw-r--r-- 6.8 KB
utimes.c -rw-r--r-- 5.6 KB
xattr.c -rw-r--r-- 14.9 KB
xattr_acl.c -rw-r--r-- 2.3 KB

back to top