aboutsummaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
authorMiklos Szeredi <mszeredi@suse.cz>2013-09-05 11:44:39 +0200
committerAl Viro <viro@zeniv.linux.org.uk>2013-09-05 16:23:51 -0400
commit1191a2bdf012147c33e5fa95255974a3f7bf6e2f (patch)
tree7a048ca9a96611474270e6a158ee0f14496d8572 /fs
parentafs: use check_submounts_and_drop() (diff)
downloadlinux-dev-1191a2bdf012147c33e5fa95255974a3f7bf6e2f.tar.xz
linux-dev-1191a2bdf012147c33e5fa95255974a3f7bf6e2f.zip
gfs2: use check_submounts_and_drop()
Do have_submounts(), shrink_dcache_parent() and d_drop() atomically. check_submounts_and_drop() can deal with negative dentries and non-directories as well. Non-directories can also be mounted on. And just like directories we don't want these to disappear with invalidation. Signed-off-by: Miklos Szeredi <mszeredi@suse.cz> CC: Steven Whitehouse <swhiteho@redhat.com> Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'fs')
-rw-r--r--fs/gfs2/dentry.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/fs/gfs2/dentry.c b/fs/gfs2/dentry.c
index f2448ab2aac5..d3a5d4e29ba5 100644
--- a/fs/gfs2/dentry.c
+++ b/fs/gfs2/dentry.c
@@ -93,12 +93,9 @@ invalid_gunlock:
if (!had_lock)
gfs2_glock_dq_uninit(&d_gh);
invalid:
- if (inode && S_ISDIR(inode->i_mode)) {
- if (have_submounts(dentry))
- goto valid;
- shrink_dcache_parent(dentry);
- }
- d_drop(dentry);
+ if (check_submounts_and_drop(dentry) != 0)
+ goto valid;
+
dput(parent);
return 0;