linux/fs
Jeff Layton 8033426e6b vfs: allow umount to handle mountpoints without revalidating them
Christopher reported a regression where he was unable to unmount a NFS
filesystem where the root had gone stale. The problem is that
d_revalidate handles the root of the filesystem differently from other
dentries, but d_weak_revalidate does not. We could simply fix this by
making d_weak_revalidate return success on IS_ROOT dentries, but there
are cases where we do want to revalidate the root of the fs.

A umount is really a special case. We generally aren't interested in
anything but the dentry and vfsmount that's attached at that point. If
the inode turns out to be stale we just don't care since the intent is
to stop using it anyway.

Try to handle this situation better by treating umount as a special
case in the lookup code. Have it resolve the parent using normal
means, and then do a lookup of the final dentry without revalidating
it. In most cases, the final lookup will come out of the dcache, but
the case where there's a trailing symlink or !LAST_NORM entry on the
end complicates things a bit.

Cc: Neil Brown <neilb@suse.de>
Reported-by: Christopher T Vogan <cvogan@us.ibm.com>
Signed-off-by: Jeff Layton <jlayton@redhat.com>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2013-09-03 22:50:29 -04:00
..
9p Second round of 9p patches for the 3.11 merge window. 2013-07-11 10:21:23 -07:00
adfs Don't pass inode to ->d_hash() and ->d_compare() 2013-06-29 12:57:36 +04:00
affs Don't pass inode to ->d_hash() and ->d_compare() 2013-06-29 12:57:36 +04:00
afs Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs 2013-07-03 09:10:19 -07:00
autofs4 helper for reading ->d_count 2013-07-05 18:59:33 +04:00
befs [readdir] convert befs 2013-06-29 12:56:55 +04:00
bfs bfs: iget_locked() doesn't return an ERR_PTR 2013-08-24 12:10:22 -04:00
btrfs btrfs: don't loop on large offsets in readdir 2013-08-09 19:34:56 -04:00
cachefiles mm: remove lru parameter from __pagevec_lru_add and remove parts of pagevec API 2013-07-03 16:07:31 -07:00
ceph Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/sage/ceph-client 2013-07-09 12:39:10 -07:00
cifs cifs: don't instantiate new dentries in readdir for inodes that need to be revalidated immediately 2013-08-07 10:57:06 -05:00
coda helper for reading ->d_count 2013-07-05 18:59:33 +04:00
configfs Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs 2013-07-14 11:42:26 -07:00
cramfs [readdir] convert f2fs 2013-06-29 12:56:46 +04:00
debugfs debugfs: debugfs_remove_recursive() must not rely on list_empty(d_subdirs) 2013-07-31 12:16:31 -04:00
devpts
dlm dlm: kill the unnecessary and wrong device_close()->recalc_sigpending() 2013-08-09 10:48:20 -07:00
ecryptfs Code cleanups and improved buffer handling during page crypto operations 2013-07-11 10:20:18 -07:00
efivarfs efivarfs: we can use simple_lookup() now 2013-07-14 17:48:35 +04:00
efs efs: iget_locked() doesn't return an ERR_PTR() 2013-08-24 12:10:22 -04:00
exofs Lots of bug fixes, cleanups and optimizations. In the bug fixes 2013-07-02 09:39:34 -07:00
exportfs [readdir] constify ->actor 2013-06-29 12:57:05 +04:00
ext2 [O_TMPFILE] it's still short a few helpers, but infrastructure should be OK now... 2013-06-29 12:57:10 +04:00
ext3 ext3: fix a BUG when opening a file with O_TMPFILE flag 2013-07-20 22:03:20 -04:00
ext4 jbd2: Fix oops in jbd2_journal_file_inode() 2013-08-16 21:19:41 -04:00
f2fs f2fs: fix readdir incorrectness 2013-07-08 13:35:48 +04:00
fat fatfs: add FAT_IOCTL_GET_VOLUME_ID 2013-07-09 10:33:25 -07:00
freevxfs [readdir] convert freevxfs 2013-06-29 12:56:53 +04:00
fscache FS-Cache: Don't use spin_is_locked() in assertions 2013-06-19 14:16:47 +01:00
fuse fuse: readdirplus: cleanup 2013-07-17 14:53:54 +02:00
gfs2 Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs 2013-07-03 09:10:19 -07:00
hfs Don't pass inode to ->d_hash() and ->d_compare() 2013-06-29 12:57:36 +04:00
hfsplus Don't pass inode to ->d_hash() and ->d_compare() 2013-06-29 12:57:36 +04:00
hostfs [readdir] convert hostfs 2013-06-29 12:56:59 +04:00
hpfs Merge branch 'hpfs' from Mikulas Patocka 2013-07-04 11:22:55 -07:00
hppfs clean up scary strncpy(dst, src, strlen(src)) uses 2013-07-03 16:07:41 -07:00
hugetlbfs cope with potentially long ->d_dname() output for shmem/hugetlb 2013-08-24 12:10:17 -04:00
isofs Don't pass inode to ->d_hash() and ->d_compare() 2013-06-29 12:57:36 +04:00
jbd jbd: change journal_invalidatepage() to accept length 2013-05-21 23:26:36 -04:00
jbd2 jbd2: invalidate handle if jbd2_journal_restart() fails 2013-07-01 08:12:41 -04:00
jffs2 [readdir] convert jffs2 2013-06-29 12:56:47 +04:00
jfs A couple cleanups to JFS for 3.11 2013-07-11 10:19:34 -07:00
lockd LOCKD: Don't call utsname()->nodename from nlmclnt_setlockargs 2013-08-05 15:03:46 -04:00
logfs Lots of bug fixes, cleanups and optimizations. In the bug fixes 2013-07-02 09:39:34 -07:00
minix minix: bug widening a binary "not" operation 2013-06-29 12:57:35 +04:00
ncpfs ncpfs: fix error return code in ncp_parse_options() 2013-07-09 10:33:25 -07:00
nfs NFSv4: Fix up nfs4_proc_lookup_mountpoint 2013-08-07 20:47:26 -04:00
nfs_common
nfsd nfsd: racy access to ->d_name in nsfd4_encode_path() 2013-09-03 22:50:28 -04:00
nilfs2 helper for reading ->d_count 2013-07-05 18:59:33 +04:00
nls
notify fsnotify: update comments concerning locking scheme 2013-07-09 10:33:20 -07:00
ntfs Lots of bug fixes, cleanups and optimizations. In the bug fixes 2013-07-02 09:39:34 -07:00
ocfs2 ocfs2: fix null pointer dereference in ocfs2_dir_foreach_blk_id() 2013-08-13 17:57:49 -07:00
omfs [readdir] convert omfs 2013-06-29 12:56:37 +04:00
openpromfs [readdir] convert openpromfs 2013-06-29 12:56:32 +04:00
proc proc: kill the extra proc_readfd_common()->dir_emit_dots() 2013-08-24 12:10:22 -04:00
pstore Merge branch 'next' of git://git.kernel.org/pub/scm/linux/kernel/git/benh/powerpc 2013-07-04 10:29:23 -07:00
qnx4 [readdir] convert qnx4 2013-06-29 12:56:38 +04:00
qnx6 [readdir] convert qnx6 2013-06-29 12:56:39 +04:00
quota quota: Convert use of typedef ctl_table to struct ctl_table 2013-07-04 19:22:55 +02:00
ramfs
reiserfs reiserfs: fix deadlock in umount 2013-08-05 17:37:37 +04:00
romfs [readdir] convert romfs 2013-06-29 12:56:29 +04:00
squashfs [readdir] convert squashfs 2013-06-29 12:56:28 +04:00
sysfs sysfs: prevent warning when only using binary attributes 2013-07-16 10:57:36 -07:00
sysv Don't pass inode to ->d_hash() and ->d_compare() 2013-06-29 12:57:36 +04:00
ubifs Only a single patch which fixes a message. 2013-07-05 12:08:47 -07:00
udf udf: provide ->tmpfile() 2013-06-29 12:57:12 +04:00
ufs [readdir] simple local unixlike: switch to ->iterate() 2013-06-29 12:46:47 +04:00
xfs xfs: di_flushiter considered harmful 2013-07-25 10:41:42 -05:00
Kconfig efivarfs: Move to fs/efivarfs 2013-04-17 13:25:09 +01:00
Kconfig.binfmt fs: make binfmt support for #! scripts modular and removable 2013-04-30 17:04:04 -07:00
Makefile Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs 2013-05-01 17:51:54 -07:00
aio.c aio: fix wrong comment in aio_complete() 2013-07-03 16:08:06 -07:00
anon_inodes.c
attr.c
bad_inode.c [readdir] ->readdir() is gone 2013-06-29 12:57:04 +04:00
binfmt_aout.c mm: remove free_area_cache 2013-07-10 18:11:34 -07:00
binfmt_elf.c mm: remove free_area_cache 2013-07-10 18:11:34 -07:00
binfmt_elf_fdpic.c Merge branch 'next' of git://git.kernel.org/pub/scm/linux/kernel/git/benh/powerpc 2013-05-02 10:16:16 -07:00
binfmt_em86.c
binfmt_flat.c new helper: read_code() 2013-04-29 15:40:23 -04:00
binfmt_misc.c binfmt_misc: reuse string_unescape_inplace() 2013-04-30 17:04:03 -07:00
binfmt_script.c
binfmt_som.c
bio-integrity.c
bio.c Merge branch 'for-3.10/core' of git://git.kernel.dk/linux-block 2013-05-08 10:13:35 -07:00
block_dev.c Merge branch 'for-3.11/core' of git://git.kernel.dk/linux-block 2013-07-11 13:03:24 -07:00
buffer.c mm: vmscan: take page buffers dirty and locked state into account 2013-07-03 16:07:29 -07:00
char_dev.c
compat.c [readdir] constify ->actor 2013-06-29 12:57:05 +04:00
compat_binfmt_elf.c
compat_ioctl.c compat.c: LOOP_CLR_FD is taken care of in loop.c itself... 2013-06-29 12:46:44 +04:00
coredump.c coredump: '% at the end' shouldn't bypass core_uses_pid logic 2013-07-03 16:08:02 -07:00
coredump.h
dcache.c vfs: call d_op->d_prune() before unhashing dentry 2013-09-03 22:50:28 -04:00
dcookies.c
direct-io.c Merge branch 'for-3.10/core' of git://git.kernel.dk/linux-block 2013-05-08 10:13:35 -07:00
drop_caches.c
eventfd.c
eventpoll.c Merge branch 'akpm' (updates from Andrew Morton) 2013-07-03 17:12:13 -07:00
exec.c Fix TLB gather virtual address range invalidation corner cases 2013-08-16 08:52:46 -07:00
fcntl.c vfs: add missing check for __O_TMPFILE in fcntl_init() 2013-08-05 18:25:32 +04:00
fhandle.c
file.c don't bother with deferred freeing of fdtables 2013-05-01 17:31:42 -04:00
file_table.c only regular files with FMODE_WRITE need to be on s_files 2013-09-03 22:50:28 -04:00
filesystems.c
fs-writeback.c mm/writeback: don't check force_wait to handle bdi->work_list 2013-07-09 10:33:22 -07:00
fs_struct.c
generic_acl.c
inode.c allow the temp files created by open() to be linked to 2013-06-29 12:57:11 +04:00
internal.h constify rw_verify_area() 2013-06-29 12:57:34 +04:00
ioctl.c
ioprio.c
libfs.c make simple_lookup() usable for filesystems that set ->s_d_op 2013-07-14 17:43:25 +04:00
locks.c locks: move file_lock_list to a set of percpu hlist_heads and convert file_lock_lock to an lglock 2013-07-08 13:36:42 +04:00
mbcache.c
mount.h
mpage.c
namei.c vfs: allow umount to handle mountpoints without revalidating them 2013-09-03 22:50:29 -04:00
namespace.c vfs: allow umount to handle mountpoints without revalidating them 2013-09-03 22:50:29 -04:00
no-block.c
open.c fs: Fix file mode for O_TMPFILE 2013-08-05 18:24:10 +04:00
pipe.c aio: don't include aio.h in sched.h 2013-05-07 20:16:25 -07:00
pnode.c vfs: Fix invalid ida_remove() call 2013-05-31 15:16:33 -04:00
pnode.h Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs 2013-05-01 17:51:54 -07:00
posix_acl.c
proc_namespace.c
read_write.c vfs: export lseek_execute() to modules 2013-07-03 16:23:27 +04:00
readdir.c [readdir] constify ->actor 2013-06-29 12:57:05 +04:00
select.c net: rename include/net/ll_poll.h to include/net/busy_poll.h 2013-07-10 17:08:27 -07:00
seq_file.c seq_file: add seq_list_*_percpu helpers 2013-07-08 13:36:41 +04:00
signalfd.c
splice.c Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs 2013-07-03 09:10:19 -07:00
stack.c
stat.c
statfs.c
super.c livelock avoidance in sget() 2013-07-20 04:58:58 +04:00
sync.c
timerfd.c timerfd: Add alarm timers 2013-05-29 12:57:34 -07:00
utimes.c
xattr.c
xattr_acl.c