summaryrefslogtreecommitdiff
path: root/fs/internal.h
diff options
context:
space:
mode:
authorMiklos Szeredi <miklos@szeredi.hu>2013-09-05 14:39:11 +0200
committerMaciej Wereski <m.wereski@partner.samsung.com>2015-03-18 09:47:14 +0100
commitaefc2bf8ec7d61dfdf3a30fd5f3ea26cb2309af7 (patch)
tree61c8fdf679a9cf12106f918f7c72d7eb78c5039d /fs/internal.h
parentfa8ba7e4eead9930011e41745e95619b6c1688c0 (diff)
downloadlinux-3.10-aefc2bf8ec7d61dfdf3a30fd5f3ea26cb2309af7.tar.gz
linux-3.10-aefc2bf8ec7d61dfdf3a30fd5f3ea26cb2309af7.tar.bz2
linux-3.10-aefc2bf8ec7d61dfdf3a30fd5f3ea26cb2309af7.zip
vfs: check unlinked ancestors before mount
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. Nor do we prevent mounts to be added to the disconnected subtree using relative paths after the d_drop(). This patch fixes these issues by checking for unlinked (unhashed, non-root) ancestors before proceeding with the mount. This is done with rename seqlock taken for write and with ->d_lock grabbed on each ancestor in turn, including our dentry itself. This ensures that the only one of check_submounts_and_drop() or has_unlinked_ancestor() can succeed. Signed-off-by: Miklos Szeredi <miklos@szeredi.hu> Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'fs/internal.h')
-rw-r--r--fs/internal.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/fs/internal.h b/fs/internal.h
index 68121584ae3..237f2205a3d 100644
--- a/fs/internal.h
+++ b/fs/internal.h
@@ -125,6 +125,7 @@ extern int invalidate_inodes(struct super_block *, bool);
* dcache.c
*/
extern struct dentry *__d_alloc(struct super_block *, const struct qstr *);
+extern int d_set_mounted(struct dentry *dentry);
/*
* read_write.c