From: Andrew Morton Cc: Andreas Mohr Signed-off-by: Andrew Morton --- fs/namei.c | 7 +++++-- 1 files changed, 5 insertions(+), 2 deletions(-) diff -puN fs/namei.c~fs-nameic-replace-multiple-current-fs-by-shortcut-variable-tidy fs/namei.c --- a/fs/namei.c~fs-nameic-replace-multiple-current-fs-by-shortcut-variable-tidy +++ a/fs/namei.c @@ -519,6 +519,7 @@ static __always_inline int walk_init_root(const char *name, struct nameidata *nd) { struct fs_struct *fs = current->fs; + read_lock(&fs->lock); if (fs->altroot && !(nd->flags & LOOKUP_NOALT)) { nd->mnt = mntget(fs->altrootmnt); @@ -726,6 +727,7 @@ int follow_down(struct vfsmount **mnt, s static __always_inline void follow_dotdot(struct nameidata *nd) { struct fs_struct *fs = current->fs; + while(1) { struct vfsmount *parent; struct dentry *old = nd->dentry; @@ -1045,9 +1047,10 @@ static int __emul_lookup_dentry(const ch struct qstr last = nd->last; int last_type = nd->last_type; struct fs_struct *fs = current->fs; + /* - * NAME was not found in alternate root or it's a directory. Try to find - * it in the normal root: + * NAME was not found in alternate root or it's a directory. + * Try to find it in the normal root: */ nd->last_type = LAST_ROOT; read_lock(&fs->lock); _