linux/fs
Miklos Szeredi 848ac114e8 vfs: check submounts and drop atomically
We check submounts before doing d_drop() on a non-empty directory dentry in
NFS (have_submounts()), but we do not exclude a racing mount.

 Process A: have_submounts() -> returns false
 Process B: mount() -> success
 Process A: d_drop()

This patch prepares the ground for the fix by doing the following
operations all under the same rename lock:

  have_submounts()
  shrink_dcache_parent()
  d_drop()

This is actually an optimization since have_submounts() and
shrink_dcache_parent() both traverse the same dentry tree separately.

Signed-off-by: Miklos Szeredi <mszeredi@suse.cz>
CC: David Howells <dhowells@redhat.com>
CC: Steven Whitehouse <swhiteho@redhat.com>
CC: Trond Myklebust <Trond.Myklebust@netapp.com>
CC: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2013-09-05 16:23:41 -04:00
..
9p Second round of 9p patches for the 3.11 merge window. 2013-07-11 10:21:23 -07:00
adfs
affs Don't pass inode to ->d_hash() and ->d_compare() 2013-06-29 12:57:36 +04:00
afs
autofs4 helper for reading ->d_count 2013-07-05 18:59:33 +04:00
befs
bfs bfs: iget_locked() doesn't return an ERR_PTR 2013-08-24 12:10:22 -04:00
btrfs Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs 2013-09-05 08:50:26 -07:00
cachefiles
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 direct-io: Handle O_(D)SYNC AIO 2013-09-04 09:23:46 -04: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
debugfs debugfs: debugfs_remove_recursive() must not rely on list_empty(d_subdirs) 2013-07-31 12:16:31 -04:00
devpts
dlm dlm: remove signal blocking 2013-08-12 15:22:43 -05: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
exportfs
ext2
ext3 ext4: Fix misspellings using 'codespell' tool 2013-08-28 14:40:12 -04:00
ext4 Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs 2013-09-05 08:50:26 -07: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
fscache
fuse Merge 3.11-rc3 into driver-core-next 2013-07-29 12:30:13 -07:00
gfs2 GFS2: Check for glock already held in gfs2_getxattr 2013-08-19 09:33:57 +01:00
hfs
hfsplus
hostfs
hpfs Merge branch 'hpfs' from Mikulas Patocka 2013-07-04 11:22:55 -07:00
hppfs
hugetlbfs cope with potentially long ->d_dname() output for shmem/hugetlb 2013-08-24 12:10:17 -04:00
isofs
jbd
jbd2 jbd2: Fix endian mixing problems in the checksumming code 2013-08-28 14:59:58 -04:00
jffs2
jfs jfs: fix readdir cookie incompatibility with NFSv4 2013-08-15 17:22:29 -05:00
lockd LOCKD: Don't call utsname()->nodename from nlmclnt_setlockargs 2013-08-05 15:03:46 -04:00
logfs
minix
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 Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs 2013-09-05 08:50:26 -07:00
nls
notify fsnotify: update comments concerning locking scheme 2013-07-09 10:33:20 -07:00
ntfs
ocfs2 Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs 2013-09-05 08:50:26 -07:00
omfs
openpromfs
proc Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs 2013-08-25 12:25:38 -07:00
pstore pstore/ram: (really) fix undefined usage of rounddown_pow_of_two 2013-08-30 15:57:01 -07:00
qnx4
qnx6
quota quota: provide interface for readding allocated space into reserved space 2013-08-17 09:32:32 -04:00
ramfs
reiserfs reiserfs: fix deadlock in umount 2013-08-05 17:37:37 +04:00
romfs
squashfs
sysfs sysfs: group.c: fix up kerneldoc 2013-08-22 09:23:28 -07:00
sysv
ubifs Only a single patch which fixes a message. 2013-07-05 12:08:47 -07:00
udf
ufs
xfs direct-io: Implement generic deferred AIO completions 2013-09-04 09:23:46 -04:00
Kconfig
Kconfig.binfmt
Makefile
aio.c
anon_inodes.c
attr.c
bad_inode.c
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
binfmt_em86.c
binfmt_flat.c
binfmt_misc.c
binfmt_script.c
binfmt_som.c
bio-integrity.c
bio.c Merge branch 'for-3.12' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/cgroup 2013-09-03 18:25:03 -07:00
block_dev.c direct-io: Handle O_(D)SYNC AIO 2013-09-04 09:23:46 -04:00
buffer.c
char_dev.c
compat.c
compat_binfmt_elf.c
compat_ioctl.c
coredump.c
coredump.h
dcache.c vfs: check submounts and drop atomically 2013-09-05 16:23:41 -04:00
dcookies.c
direct-io.c direct-io: Handle O_(D)SYNC AIO 2013-09-04 09:23:46 -04:00
drop_caches.c
eventfd.c
eventpoll.c switch epoll_ctl() to fdget 2013-09-03 23:04:44 -04: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
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 constify touch_atime() 2013-09-03 22:52:45 -04:00
internal.h
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 Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs 2013-09-05 08:50:26 -07: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 switch fchmod() to fdget 2013-09-03 23:04:45 -04:00
pipe.c
pnode.c
pnode.h
posix_acl.c
proc_namespace.c
read_write.c
readdir.c
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
stack.c
stat.c quota: provide interface for readding allocated space into reserved space 2013-08-17 09:32:32 -04:00
statfs.c
super.c direct-io: Implement generic deferred AIO completions 2013-09-04 09:23:46 -04:00
sync.c
timerfd.c
utimes.c
xattr.c
xattr_acl.c