Re: lock_kernel called under spinlock in NFS

From: Trond Myklebust
Date: Sat Jun 03 2006 - 18:16:07 EST


On Sat, 2006-06-03 at 22:30 +0400, Sergey Vlasov wrote:

> 2) The patch above is broken - it needs the fix below (or the fix should
> be folded into the patch directly):

Duh... You're quite right. Sorry about missing that.

Cheers,
Trond

> --------------------------------------------------------------------
>
> Fix do_path_lookup() failure path after locking changes
>
> Signed-off-by: Sergey Vlasov <vsu@xxxxxxxxxxx>
> ---
> fs/namei.c | 13 ++++++-------
> 1 files changed, 6 insertions(+), 7 deletions(-)
>
> diff --git a/fs/namei.c b/fs/namei.c
> index a2f79d2..d6e2ee2 100644
> --- a/fs/namei.c
> +++ b/fs/namei.c
> @@ -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(&current->fs->lock);
> - return retval;
> + goto out_fail;
> }
>
> int fastcall path_lookup(const char *name, unsigned int flags,
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/