diff options
author | Al Viro <viro@zeniv.linux.org.uk> | 2015-05-12 00:10:18 -0400 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2015-05-15 01:10:36 -0400 |
commit | 5a8d87e8ed1d6aabdb865fea31e337b2c627dbe0 (patch) | |
tree | ed93c5bf6dd9c08425b7b1697b48bbcdb94b7450 /fs/namei.c | |
parent | 203bc643db59e2538e9a3f19be1636cdfd2bb2db (diff) |
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
diff --git a/fs/namei.c b/fs/namei.c index a5ed0d070a20..0cccb24ac0b7 100644 --- a/fs/namei.c +++ b/fs/namei.c | |||
@@ -651,7 +651,6 @@ static bool legitimize_links(struct nameidata *nd) | |||
651 | */ | 651 | */ |
652 | static int unlazy_walk(struct nameidata *nd, struct dentry *dentry, unsigned seq) | 652 | static int unlazy_walk(struct nameidata *nd, struct dentry *dentry, unsigned seq) |
653 | { | 653 | { |
654 | struct fs_struct *fs = current->fs; | ||
655 | struct dentry *parent = nd->path.dentry; | 654 | struct dentry *parent = nd->path.dentry; |
656 | 655 | ||
657 | BUG_ON(!(nd->flags & LOOKUP_RCU)); | 656 | BUG_ON(!(nd->flags & LOOKUP_RCU)); |
@@ -691,13 +690,11 @@ static int unlazy_walk(struct nameidata *nd, struct dentry *dentry, unsigned seq | |||
691 | * still valid and get it if required. | 690 | * still valid and get it if required. |
692 | */ | 691 | */ |
693 | if (nd->root.mnt && !(nd->flags & LOOKUP_ROOT)) { | 692 | if (nd->root.mnt && !(nd->flags & LOOKUP_ROOT)) { |
694 | spin_lock(&fs->lock); | 693 | if (unlikely(!legitimize_path(nd, &nd->root, nd->root_seq))) { |
695 | if (unlikely(!path_equal(&nd->root, &fs->root))) { | 694 | rcu_read_unlock(); |
696 | spin_unlock(&fs->lock); | 695 | dput(dentry); |
697 | goto drop_dentry; | 696 | return -ECHILD; |
698 | } | 697 | } |
699 | path_get(&nd->root); | ||
700 | spin_unlock(&fs->lock); | ||
701 | } | 698 | } |
702 | 699 | ||
703 | rcu_read_unlock(); | 700 | rcu_read_unlock(); |