vfs: Remove unnecessary calls of check_submounts_and_drop
authorEric W. Biederman <ebiederm@xmission.com>
Thu, 13 Feb 2014 17:34:30 +0000 (09:34 -0800)
committerAl Viro <viro@zeniv.linux.org.uk>
Thu, 9 Oct 2014 06:38:56 +0000 (02:38 -0400)
Now that check_submounts_and_drop can not fail and is called from
d_invalidate there is no longer a need to call check_submounts_and_drom
from filesystem d_revalidate methods so remove it.

Reviewed-by: Miklos Szeredi <miklos@szeredi.hu>
Signed-off-by: "Eric W. Biederman" <ebiederm@xmission.com>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
fs/afs/dir.c
fs/fuse/dir.c
fs/gfs2/dentry.c
fs/kernfs/dir.c
fs/nfs/dir.c

index 529300327f4574d2dc36345be3c7398442548e08..a1645b88fe8a47d9a54fde42f1e5084932c96b94 100644 (file)
@@ -669,7 +669,6 @@ static int afs_d_revalidate(struct dentry *dentry, unsigned int flags)
 
 out_valid:
        dentry->d_fsdata = dir_version;
-out_skip:
        dput(parent);
        key_put(key);
        _leave(" = 1 [valid]");
@@ -682,10 +681,6 @@ not_found:
        spin_unlock(&dentry->d_lock);
 
 out_bad:
-       /* don't unhash if we have submounts */
-       if (check_submounts_and_drop(dentry) != 0)
-               goto out_skip;
-
        _debug("dropping dentry %s/%s",
               parent->d_name.name, dentry->d_name.name);
        dput(parent);
index de1d84af9f7c6baf27b64218fbff43604ab47c04..820efd74ca9fec310f84645d6a945fdf7c1205c6 100644 (file)
@@ -274,9 +274,6 @@ out:
 
 invalid:
        ret = 0;
-
-       if (!(flags & LOOKUP_RCU) && check_submounts_and_drop(entry) != 0)
-               ret = 1;
        goto out;
 }
 
index d3a5d4e29ba5f37b10f4f0fd0043c7e9847b9923..589f4ea9381c4518de238d786f56433512c57565 100644 (file)
@@ -93,9 +93,6 @@ invalid_gunlock:
        if (!had_lock)
                gfs2_glock_dq_uninit(&d_gh);
 invalid:
-       if (check_submounts_and_drop(dentry) != 0)
-               goto valid;
-
        dput(parent);
        return 0;
 
index a693f5b01ae6ebdda49911cab77f8d75deb97306..1c771931bb602426ddb697e88ec1fc8bb6ebf233 100644 (file)
@@ -463,21 +463,10 @@ static int kernfs_dop_revalidate(struct dentry *dentry, unsigned int flags)
                goto out_bad;
 
        mutex_unlock(&kernfs_mutex);
-out_valid:
        return 1;
 out_bad:
        mutex_unlock(&kernfs_mutex);
 out_bad_unlocked:
-       /*
-        * @dentry doesn't match the underlying kernfs node, drop the
-        * dentry and force lookup.  If we have submounts we must allow the
-        * vfs caches to lie about the state of the filesystem to prevent
-        * leaks and other nasty things, so use check_submounts_and_drop()
-        * instead of d_drop().
-        */
-       if (check_submounts_and_drop(dentry) != 0)
-               goto out_valid;
-
        return 0;
 }
 
index 36d921f0c6026c27170b565f46eb4e26999ea812..8be6988a1c6c6df9b267ea6dfba3d673213f1437 100644 (file)
@@ -1211,10 +1211,6 @@ out_zap_parent:
                if (IS_ROOT(dentry))
                        goto out_valid;
        }
-       /* If we have submounts, don't unhash ! */
-       if (check_submounts_and_drop(dentry) != 0)
-               goto out_valid;
-
        dput(parent);
        dfprintk(LOOKUPCACHE, "NFS: %s(%pd2) is invalid\n",
                        __func__, dentry);