Commit 9b053f32 authored by Eric W. Biederman's avatar Eric W. Biederman Committed by Al Viro

vfs: Remove unnecessary calls of check_submounts_and_drop

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: default avatarMiklos Szeredi <miklos@szeredi.hu>
Signed-off-by: default avatar"Eric W. Biederman" <ebiederm@xmission.com>
Signed-off-by: default avatarAl Viro <viro@zeniv.linux.org.uk>
parent 8ed936b5
...@@ -669,7 +669,6 @@ static int afs_d_revalidate(struct dentry *dentry, unsigned int flags) ...@@ -669,7 +669,6 @@ static int afs_d_revalidate(struct dentry *dentry, unsigned int flags)
out_valid: out_valid:
dentry->d_fsdata = dir_version; dentry->d_fsdata = dir_version;
out_skip:
dput(parent); dput(parent);
key_put(key); key_put(key);
_leave(" = 1 [valid]"); _leave(" = 1 [valid]");
...@@ -682,10 +681,6 @@ static int afs_d_revalidate(struct dentry *dentry, unsigned int flags) ...@@ -682,10 +681,6 @@ static int afs_d_revalidate(struct dentry *dentry, unsigned int flags)
spin_unlock(&dentry->d_lock); spin_unlock(&dentry->d_lock);
out_bad: out_bad:
/* don't unhash if we have submounts */
if (check_submounts_and_drop(dentry) != 0)
goto out_skip;
_debug("dropping dentry %s/%s", _debug("dropping dentry %s/%s",
parent->d_name.name, dentry->d_name.name); parent->d_name.name, dentry->d_name.name);
dput(parent); dput(parent);
......
...@@ -274,9 +274,6 @@ static int fuse_dentry_revalidate(struct dentry *entry, unsigned int flags) ...@@ -274,9 +274,6 @@ static int fuse_dentry_revalidate(struct dentry *entry, unsigned int flags)
invalid: invalid:
ret = 0; ret = 0;
if (!(flags & LOOKUP_RCU) && check_submounts_and_drop(entry) != 0)
ret = 1;
goto out; goto out;
} }
......
...@@ -93,9 +93,6 @@ static int gfs2_drevalidate(struct dentry *dentry, unsigned int flags) ...@@ -93,9 +93,6 @@ static int gfs2_drevalidate(struct dentry *dentry, unsigned int flags)
if (!had_lock) if (!had_lock)
gfs2_glock_dq_uninit(&d_gh); gfs2_glock_dq_uninit(&d_gh);
invalid: invalid:
if (check_submounts_and_drop(dentry) != 0)
goto valid;
dput(parent); dput(parent);
return 0; return 0;
......
...@@ -463,21 +463,10 @@ static int kernfs_dop_revalidate(struct dentry *dentry, unsigned int flags) ...@@ -463,21 +463,10 @@ static int kernfs_dop_revalidate(struct dentry *dentry, unsigned int flags)
goto out_bad; goto out_bad;
mutex_unlock(&kernfs_mutex); mutex_unlock(&kernfs_mutex);
out_valid:
return 1; return 1;
out_bad: out_bad:
mutex_unlock(&kernfs_mutex); mutex_unlock(&kernfs_mutex);
out_bad_unlocked: 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; return 0;
} }
......
...@@ -1211,10 +1211,6 @@ static int nfs_lookup_revalidate(struct dentry *dentry, unsigned int flags) ...@@ -1211,10 +1211,6 @@ static int nfs_lookup_revalidate(struct dentry *dentry, unsigned int flags)
if (IS_ROOT(dentry)) if (IS_ROOT(dentry))
goto out_valid; goto out_valid;
} }
/* If we have submounts, don't unhash ! */
if (check_submounts_and_drop(dentry) != 0)
goto out_valid;
dput(parent); dput(parent);
dfprintk(LOOKUPCACHE, "NFS: %s(%pd2) is invalid\n", dfprintk(LOOKUPCACHE, "NFS: %s(%pd2) is invalid\n",
__func__, dentry); __func__, dentry);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment