diff options
author | Josh Triplett <josht@us.ibm.com> | 2006-07-24 19:30:00 -0400 |
---|---|---|
committer | Trond Myklebust <Trond.Myklebust@netapp.com> | 2006-08-03 16:55:01 -0400 |
commit | ce510193272c295b891e45525a83b543ae3207c1 (patch) | |
tree | 4b343858aa43e2a1e549ea23c5cff4cf86aeff47 /fs/nfs/namespace.c | |
parent | 3f2792ffbd88dc1cd41d226674cc428914981e98 (diff) |
NFS: Release dcache_lock in an error path of nfs_path
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>
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
(cherry picked from f4b90b43677fb23297c56802c3056fc304f988d9 commit)
Diffstat (limited to 'fs/nfs/namespace.c')
-rw-r--r-- | 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 19b98ca468eb..86b3169c8cac 100644 --- a/fs/nfs/namespace.c +++ b/fs/nfs/namespace.c | |||
@@ -51,7 +51,7 @@ char *nfs_path(const char *base, const struct dentry *dentry, | |||
51 | namelen = dentry->d_name.len; | 51 | namelen = dentry->d_name.len; |
52 | buflen -= namelen + 1; | 52 | buflen -= namelen + 1; |
53 | if (buflen < 0) | 53 | if (buflen < 0) |
54 | goto Elong; | 54 | goto Elong_unlock; |
55 | end -= namelen; | 55 | end -= namelen; |
56 | memcpy(end, dentry->d_name.name, namelen); | 56 | memcpy(end, dentry->d_name.name, namelen); |
57 | *--end = '/'; | 57 | *--end = '/'; |
@@ -68,6 +68,8 @@ char *nfs_path(const char *base, const struct dentry *dentry, | |||
68 | end -= namelen; | 68 | end -= namelen; |
69 | memcpy(end, base, namelen); | 69 | memcpy(end, base, namelen); |
70 | return end; | 70 | return end; |
71 | Elong_unlock: | ||
72 | spin_unlock(&dcache_lock); | ||
71 | Elong: | 73 | Elong: |
72 | return ERR_PTR(-ENAMETOOLONG); | 74 | return ERR_PTR(-ENAMETOOLONG); |
73 | } | 75 | } |