All of lore.kernel.org
 help / color / mirror / Atom feed
From: Trond Myklebust <trond.myklebust@fys.uio.no>
To: Josh Triplett <josht@us.ibm.com>
Cc: linux-kernel@vger.kernel.org, Andrew Morton <akpm@osdl.org>
Subject: Re: [PATCH] [nfs] Release dentry_lock in an error path of nfs_path
Date: Tue, 25 Jul 2006 13:20:15 -0400	[thread overview]
Message-ID: <1153848015.5639.17.camel@localhost> (raw)
In-Reply-To: <1153783800.31581.21.camel@josh-work.beaverton.ibm.com>

On Mon, 2006-07-24 at 16:30 -0700, Josh Triplett wrote:
> In one of the error paths of nfs_path, it may return with dentry_lock still
> held; fix this by adding and using a new error path Elong_unlock which unlocks
> dentry_lock.
> 
> Signed-off-by: Josh Triplett <josh@freedesktop.org>

Applied to the NFS git tree... Thanks!

  Trond

> ---
>  fs/nfs/namespace.c |    4 +++-
>  1 files changed, 3 insertions(+), 1 deletions(-)
> 
> diff --git a/fs/nfs/namespace.c b/fs/nfs/namespace.c
> index 19b98ca..86b3169 100644
> --- a/fs/nfs/namespace.c
> +++ b/fs/nfs/namespace.c
> @@ -51,7 +51,7 @@ char *nfs_path(const char *base, const s
>  		namelen = dentry->d_name.len;
>  		buflen -= namelen + 1;
>  		if (buflen < 0)
> -			goto Elong;
> +			goto Elong_unlock;
>  		end -= namelen;
>  		memcpy(end, dentry->d_name.name, namelen);
>  		*--end = '/';
> @@ -68,6 +68,8 @@ char *nfs_path(const char *base, const s
>  	end -= namelen;
>  	memcpy(end, base, namelen);
>  	return end;
> +Elong_unlock:
> +	spin_unlock(&dcache_lock);
>  Elong:
>  	return ERR_PTR(-ENAMETOOLONG);
>  }
> 
> 


  reply	other threads:[~2006-07-25 17:20 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-07-24 23:30 [PATCH] [nfs] Release dentry_lock in an error path of nfs_path Josh Triplett
2006-07-25 17:20 ` Trond Myklebust [this message]
2006-07-27 18:06   ` [PATCH v2] nfs: Release dcache_lock " Josh Triplett

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1153848015.5639.17.camel@localhost \
    --to=trond.myklebust@fys.uio.no \
    --cc=akpm@osdl.org \
    --cc=josht@us.ibm.com \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.