diff options
author | Al Viro <viro@zeniv.linux.org.uk> | 2015-05-12 04:10:18 (GMT) |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2015-05-15 05:10:36 (GMT) |
commit | 5a8d87e8ed1d6aabdb865fea31e337b2c627dbe0 (patch) | |
tree | ed93c5bf6dd9c08425b7b1697b48bbcdb94b7450 /fs/namei.c | |
parent | 203bc643db59e2538e9a3f19be1636cdfd2bb2db (diff) | |
download | linux-5a8d87e8ed1d6aabdb865fea31e337b2c627dbe0.tar.xz |
namei: unlazy_walk() doesn't need to mess with current->fs anymore
now that we have ->root_seq, legitimize_path(&nd->root, nd->root_seq)
will do just fine...
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'fs/namei.c')
-rw-r--r-- | fs/namei.c | 11 |
1 files changed, 4 insertions, 7 deletions
@@ -651,7 +651,6 @@ static bool legitimize_links(struct nameidata *nd) */ static int unlazy_walk(struct nameidata *nd, struct dentry *dentry, unsigned seq) { - struct fs_struct *fs = current->fs; struct dentry *parent = nd->path.dentry; BUG_ON(!(nd->flags & LOOKUP_RCU)); @@ -691,13 +690,11 @@ static int unlazy_walk(struct nameidata *nd, struct dentry *dentry, unsigned seq * still valid and get it if required. */ if (nd->root.mnt && !(nd->flags & LOOKUP_ROOT)) { - spin_lock(&fs->lock); - if (unlikely(!path_equal(&nd->root, &fs->root))) { - spin_unlock(&fs->lock); - goto drop_dentry; + if (unlikely(!legitimize_path(nd, &nd->root, nd->root_seq))) { + rcu_read_unlock(); + dput(dentry); + return -ECHILD; } - path_get(&nd->root); - spin_unlock(&fs->lock); } rcu_read_unlock(); |