* [PATCH] [nfs] Release dentry_lock in an error path of nfs_path
@ 2006-07-24 23:30 Josh Triplett
2006-07-25 17:20 ` Trond Myklebust
0 siblings, 1 reply; 3+ messages in thread
From: Josh Triplett @ 2006-07-24 23:30 UTC (permalink / raw)
To: linux-kernel; +Cc: Andrew Morton, Trond Myklebust
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>
---
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);
}
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] [nfs] Release dentry_lock in an error path of nfs_path
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
2006-07-27 18:06 ` [PATCH v2] nfs: Release dcache_lock " Josh Triplett
0 siblings, 1 reply; 3+ messages in thread
From: Trond Myklebust @ 2006-07-25 17:20 UTC (permalink / raw)
To: Josh Triplett; +Cc: linux-kernel, Andrew Morton
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);
> }
>
>
^ permalink raw reply [flat|nested] 3+ messages in thread
* [PATCH v2] nfs: Release dcache_lock in an error path of nfs_path
2006-07-25 17:20 ` Trond Myklebust
@ 2006-07-27 18:06 ` Josh Triplett
0 siblings, 0 replies; 3+ messages in thread
From: Josh Triplett @ 2006-07-27 18:06 UTC (permalink / raw)
To: linux-kernel; +Cc: Andrew Morton, Trond Myklebust
In one of the error paths of nfs_path, it may return with dcache_lock still
held; fix this by adding and using a new error path Elong_unlock which unlocks
dcache_lock.
Signed-off-by: Josh Triplett <josh@freedesktop.org>
---
Fixed commit message typo from previous version: s/dentry_lock/dcache_lock/g.
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);
}
^ permalink raw reply related [flat|nested] 3+ messages in thread
end of thread, other threads:[~2006-07-27 18:06 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
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
2006-07-27 18:06 ` [PATCH v2] nfs: Release dcache_lock " Josh Triplett
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).