From: Sergey Vlasov Fix do_path_lookup() failure path after locking changes Signed-off-by: Sergey Vlasov Acked-by: Trond Myklebust Cc: Al Viro Signed-off-by: Andrew Morton --- fs/namei.c | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff -puN fs/namei.c~fs-nameic-call-to-file_permission-under-a-spinlock-in-do_lookup_path-fix fs/namei.c --- devel/fs/namei.c~fs-nameic-call-to-file_permission-under-a-spinlock-in-do_lookup_path-fix 2006-06-03 16:32:50.000000000 -0700 +++ devel-akpm/fs/namei.c 2006-06-03 16:32:50.000000000 -0700 @@ -1104,17 +1104,17 @@ static int fastcall do_path_lookup(int d file = fget_light(dfd, &fput_needed); retval = -EBADF; if (!file) - goto unlock_fail; + goto out_fail; dentry = file->f_dentry; retval = -ENOTDIR; if (!S_ISDIR(dentry->d_inode->i_mode)) - goto fput_unlock_fail; + goto fput_fail; retval = file_permission(file, MAY_EXEC); if (retval) - goto fput_unlock_fail; + goto fput_fail; nd->mnt = mntget(file->f_vfsmnt); nd->dentry = dget(dentry); @@ -1129,13 +1129,12 @@ out: nd->dentry->d_inode)) audit_inode(name, nd->dentry->d_inode, flags); } +out_fail: return retval; -fput_unlock_fail: +fput_fail: fput_light(file, fput_needed); -unlock_fail: - read_unlock(¤t->fs->lock); - return retval; + goto out_fail; } int fastcall path_lookup(const char *name, unsigned int flags, _