gfs2: use check_submounts_and_drop()
authorMiklos Szeredi <mszeredi@suse.cz>
Thu, 5 Sep 2013 09:44:39 +0000 (11:44 +0200)
committerAl Viro <viro@zeniv.linux.org.uk>
Thu, 5 Sep 2013 20:23:51 +0000 (16:23 -0400)
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>
fs/gfs2/dentry.c

index f2448ab2aac54d99306140a192afa1c1d9e3dc46..d3a5d4e29ba5f37b10f4f0fd0043c7e9847b9923 100644 (file)
@@ -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;