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
Kconfig -rw-r--r-- 8.2 KB
Kconfig.debug -rw-r--r-- 977 bytes
Makefile -rw-r--r-- 1.6 KB
allocpercpu.c -rw-r--r-- 4.1 KB
backing-dev.c -rw-r--r-- 7.6 KB
bootmem.c -rw-r--r-- 18.8 KB
bounce.c -rw-r--r-- 6.5 KB
debug-pagealloc.c -rw-r--r-- 2.5 KB
dmapool.c -rw-r--r-- 12.9 KB
fadvise.c -rw-r--r-- 3.3 KB
failslab.c -rw-r--r-- 1.3 KB
filemap.c -rw-r--r-- 66.4 KB
filemap_xip.c -rw-r--r-- 11.0 KB
fremap.c -rw-r--r-- 6.7 KB
highmem.c -rw-r--r-- 11.2 KB
hugetlb.c -rw-r--r-- 61.7 KB
init-mm.c -rw-r--r-- 538 bytes
internal.h -rw-r--r-- 7.3 KB
kmemcheck.c -rw-r--r-- 2.8 KB
kmemleak-test.c -rw-r--r-- 3.3 KB
kmemleak.c -rw-r--r-- 41.7 KB
maccess.c -rw-r--r-- 1.4 KB
madvise.c -rw-r--r-- 9.8 KB
memcontrol.c -rw-r--r-- 63.8 KB
memory.c -rw-r--r-- 91.0 KB
memory_hotplug.c -rw-r--r-- 20.9 KB
mempolicy.c -rw-r--r-- 60.6 KB
mempool.c -rw-r--r-- 9.0 KB
migrate.c -rw-r--r-- 25.8 KB
mincore.c -rw-r--r-- 5.7 KB
mlock.c -rw-r--r-- 16.0 KB
mm_init.c -rw-r--r-- 3.7 KB
mmap.c -rw-r--r-- 64.5 KB
mmu_notifier.c -rw-r--r-- 8.2 KB
mmzone.c -rw-r--r-- 1.8 KB
mprotect.c -rw-r--r-- 7.7 KB
mremap.c -rw-r--r-- 11.1 KB
msync.c -rw-r--r-- 2.4 KB
nommu.c -rw-r--r-- 45.9 KB
oom_kill.c -rw-r--r-- 16.1 KB
page-writeback.c -rw-r--r-- 39.9 KB
page_alloc.c -rw-r--r-- 134.8 KB
page_cgroup.c -rw-r--r-- 10.0 KB
page_io.c -rw-r--r-- 3.4 KB
page_isolation.c -rw-r--r-- 3.6 KB
pagewalk.c -rw-r--r-- 3.2 KB
pdflush.c -rw-r--r-- 7.0 KB
percpu.c -rw-r--r-- 36.3 KB
prio_tree.c -rw-r--r-- 6.3 KB
quicklist.c -rw-r--r-- 2.5 KB
readahead.c -rw-r--r-- 14.9 KB
rmap.c -rw-r--r-- 34.7 KB
shmem.c -rw-r--r-- 68.9 KB
shmem_acl.c -rw-r--r-- 4.1 KB
slab.c -rw-r--r-- 116.8 KB
slob.c -rw-r--r-- 17.1 KB
slub.c -rw-r--r-- 110.7 KB
sparse-vmemmap.c -rw-r--r-- 4.2 KB
sparse.c -rw-r--r-- 16.2 KB
swap.c -rw-r--r-- 12.9 KB
swap_state.c -rw-r--r-- 10.1 KB
swapfile.c -rw-r--r-- 55.4 KB
thrash.c -rw-r--r-- 1.9 KB
truncate.c -rw-r--r-- 12.8 KB
util.c -rw-r--r-- 6.5 KB
vmalloc.c -rw-r--r-- 46.4 KB
vmscan.c -rw-r--r-- 76.7 KB
vmstat.c -rw-r--r-- 22.0 KB

back to top