diff mbox

[16/20] VFS/namei: enable RCU-walk when following symlinks.

Message ID 20150323023740.8161.65198.stgit@notabene.brown (mailing list archive)
State New, archived
Headers show

Commit Message

NeilBrown March 23, 2015, 2:37 a.m. UTC
Now that follow_link handles LOOKUP_RCU, we do not need to
'unlazy_walk' when a symlink is found.

As we remain in RCU-walk mode, dentry->d_inode can change
so the BUG_ON() assertions are no longer appropriate.

Signed-off-by: NeilBrown <neilb@suse.de>
---
 fs/namei.c |   21 +++------------------
 1 file changed, 3 insertions(+), 18 deletions(-)



--
To unsubscribe from this list: send the line "unsubscribe linux-fsdevel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/fs/namei.c b/fs/namei.c
index 40ff4cb04244..0f5b627bd78e 100644
--- a/fs/namei.c
+++ b/fs/namei.c
@@ -1636,16 +1636,9 @@  static inline int walk_component(struct nameidata *nd, struct path *path,
 	if (!inode || d_is_negative(path->dentry))
 		goto out_path_put;
 
-	if (should_follow_link(path->dentry, follow)) {
-		if (nd->flags & LOOKUP_RCU) {
-			if (unlikely(unlazy_walk(nd, path->dentry))) {
-				err = -ECHILD;
-				goto out_err;
-			}
-		}
-		BUG_ON(inode != path->dentry->d_inode);
+	if (should_follow_link(path->dentry, follow))
 		return 1;
-	}
+
 	path_to_nameidata(path, nd);
 	nd->inode = inode;
 	return 0;
@@ -3102,16 +3095,8 @@  finish_lookup:
 		goto out;
 	}
 
-	if (should_follow_link(path->dentry, !symlink_ok)) {
-		if (nd->flags & LOOKUP_RCU) {
-			if (unlikely(unlazy_walk(nd, path->dentry))) {
-				error = -ECHILD;
-				goto out;
-			}
-		}
-		BUG_ON(inode != path->dentry->d_inode);
+	if (should_follow_link(path->dentry, !symlink_ok))
 		return 1;
-	}
 
 	if ((nd->flags & LOOKUP_RCU) || nd->path.mnt != path->mnt) {
 		path_to_nameidata(path, nd);