aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEric W. Biederman <ebiederm@xmission.com>2014-02-13 12:34:30 -0500
committerAl Viro <viro@zeniv.linux.org.uk>2014-10-09 02:38:56 -0400
commit9b053f3207e8887fed88162a339fdd4001abcdb2 (patch)
tree7751f057ee6c8ecd6cdb8d613c94db5c6dd632f7
parent8ed936b5671bfb33d89bc60bdcc7cf0470ba52fe (diff)
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: Miklos Szeredi <miklos@szeredi.hu> Signed-off-by: "Eric W. Biederman" <ebiederm@xmission.com> Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
-rw-r--r--fs/afs/dir.c5
-rw-r--r--fs/fuse/dir.c3
-rw-r--r--fs/gfs2/dentry.c3
-rw-r--r--fs/kernfs/dir.c11
-rw-r--r--fs/nfs/dir.c4
5 files changed, 0 insertions, 26 deletions
diff --git a/fs/afs/dir.c b/fs/afs/dir.c
index 529300327f45..a1645b88fe8a 100644
--- a/fs/afs/dir.c
+++ b/fs/afs/dir.c
@@ -669,7 +669,6 @@ static int afs_d_revalidate(struct dentry *dentry, unsigned int flags)
669 669
670out_valid: 670out_valid:
671 dentry->d_fsdata = dir_version; 671 dentry->d_fsdata = dir_version;
672out_skip:
673 dput(parent); 672 dput(parent);
674 key_put(key); 673 key_put(key);
675 _leave(" = 1 [valid]"); 674 _leave(" = 1 [valid]");
@@ -682,10 +681,6 @@ not_found:
682 spin_unlock(&dentry->d_lock); 681 spin_unlock(&dentry->d_lock);
683 682
684out_bad: 683out_bad:
685 /* don't unhash if we have submounts */
686 if (check_submounts_and_drop(dentry) != 0)
687 goto out_skip;
688
689 _debug("dropping dentry %s/%s", 684 _debug("dropping dentry %s/%s",
690 parent->d_name.name, dentry->d_name.name); 685 parent->d_name.name, dentry->d_name.name);
691 dput(parent); 686 dput(parent);
diff --git a/fs/fuse/dir.c b/fs/fuse/dir.c
index de1d84af9f7c..820efd74ca9f 100644
--- a/fs/fuse/dir.c
+++ b/fs/fuse/dir.c
@@ -274,9 +274,6 @@ out:
274 274
275invalid: 275invalid:
276 ret = 0; 276 ret = 0;
277
278 if (!(flags & LOOKUP_RCU) && check_submounts_and_drop(entry) != 0)
279 ret = 1;
280 goto out; 277 goto out;
281} 278}
282 279
diff --git a/fs/gfs2/dentry.c b/fs/gfs2/dentry.c
index d3a5d4e29ba5..589f4ea9381c 100644
--- a/fs/gfs2/dentry.c
+++ b/fs/gfs2/dentry.c
@@ -93,9 +93,6 @@ invalid_gunlock:
93 if (!had_lock) 93 if (!had_lock)
94 gfs2_glock_dq_uninit(&d_gh); 94 gfs2_glock_dq_uninit(&d_gh);
95invalid: 95invalid:
96 if (check_submounts_and_drop(dentry) != 0)
97 goto valid;
98
99 dput(parent); 96 dput(parent);
100 return 0; 97 return 0;
101 98
diff --git a/fs/kernfs/dir.c b/fs/kernfs/dir.c
index a693f5b01ae6..1c771931bb60 100644
--- a/fs/kernfs/dir.c
+++ b/fs/kernfs/dir.c
@@ -463,21 +463,10 @@ static int kernfs_dop_revalidate(struct dentry *dentry, unsigned int flags)
463 goto out_bad; 463 goto out_bad;
464 464
465 mutex_unlock(&kernfs_mutex); 465 mutex_unlock(&kernfs_mutex);
466out_valid:
467 return 1; 466 return 1;
468out_bad: 467out_bad:
469 mutex_unlock(&kernfs_mutex); 468 mutex_unlock(&kernfs_mutex);
470out_bad_unlocked: 469out_bad_unlocked:
471 /*
472 * @dentry doesn't match the underlying kernfs node, drop the
473 * dentry and force lookup. If we have submounts we must allow the
474 * vfs caches to lie about the state of the filesystem to prevent
475 * leaks and other nasty things, so use check_submounts_and_drop()
476 * instead of d_drop().
477 */
478 if (check_submounts_and_drop(dentry) != 0)
479 goto out_valid;
480
481 return 0; 470 return 0;
482} 471}
483 472
diff --git a/fs/nfs/dir.c b/fs/nfs/dir.c
index 36d921f0c602..8be6988a1c6c 100644
--- a/fs/nfs/dir.c
+++ b/fs/nfs/dir.c
@@ -1211,10 +1211,6 @@ out_zap_parent:
1211 if (IS_ROOT(dentry)) 1211 if (IS_ROOT(dentry))
1212 goto out_valid; 1212 goto out_valid;
1213 } 1213 }
1214 /* If we have submounts, don't unhash ! */
1215 if (check_submounts_and_drop(dentry) != 0)
1216 goto out_valid;
1217
1218 dput(parent); 1214 dput(parent);
1219 dfprintk(LOOKUPCACHE, "NFS: %s(%pd2) is invalid\n", 1215 dfprintk(LOOKUPCACHE, "NFS: %s(%pd2) is invalid\n",
1220 __func__, dentry); 1216 __func__, dentry);