fs/namei.c | 17 ++--------------- 1 file changed, 2 insertions(+), 15 deletions(-) diff --git a/fs/namei.c b/fs/namei.c index 56e4f4d537d0..8c6c94aba880 100644 --- a/fs/namei.c +++ b/fs/namei.c @@ -506,7 +506,6 @@ static inline void unlock_rcu_walk(void) */ static int unlazy_walk(struct nameidata *nd, struct dentry *dentry) { - struct fs_struct *fs = current->fs; struct dentry *parent = nd->path.dentry; BUG_ON(!(nd->flags & LOOKUP_RCU)); @@ -531,6 +530,8 @@ static int unlazy_walk(struct nameidata *nd, struct dentry *dentry) */ mntget(nd->path.mnt); nd->flags &= ~LOOKUP_RCU; + if (!(nd->flags & LOOKUP_ROOT)) + nd->root.mnt = NULL; /* * For a negative lookup, the lookup sequence point is the parents @@ -554,23 +555,9 @@ static int unlazy_walk(struct nameidata *nd, struct dentry *dentry) goto drop_dentry; } - /* - * Sequence counts matched. Now make sure that the root is - * still valid and get it if required. - */ - if (nd->root.mnt && !(nd->flags & LOOKUP_ROOT)) { - spin_lock(&fs->lock); - if (nd->root.mnt != fs->root.mnt || nd->root.dentry != fs->root.dentry) - goto unlock_and_drop_dentry; - path_get(&nd->root); - spin_unlock(&fs->lock); - } - unlock_rcu_walk(); return 0; -unlock_and_drop_dentry: - spin_unlock(&fs->lock); drop_dentry: unlock_rcu_walk(); dput(dentry);