diff options
author | Trond Myklebust <Trond.Myklebust@netapp.com> | 2009-06-22 15:09:14 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2009-06-23 00:28:25 -0400 |
commit | 0b75b35c7cad33e7613f5adf28fa10fe8b09b1c3 (patch) | |
tree | 92b9987a33dc791aed752469ea7aed6e00a63b36 | |
parent | c02d7adf8c5429727a98bad1d039bccad4c61c50 (diff) |
NFS: Fix nfs_path() to always return a '/' at the beginning of the path
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
-rw-r--r-- | fs/nfs/namespace.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/fs/nfs/namespace.c b/fs/nfs/namespace.c index f01caec8446..40c76678289 100644 --- a/fs/nfs/namespace.c +++ b/fs/nfs/namespace.c | |||
@@ -65,6 +65,11 @@ char *nfs_path(const char *base, | |||
65 | dentry = dentry->d_parent; | 65 | dentry = dentry->d_parent; |
66 | } | 66 | } |
67 | spin_unlock(&dcache_lock); | 67 | spin_unlock(&dcache_lock); |
68 | if (*end != '/') { | ||
69 | if (--buflen < 0) | ||
70 | goto Elong; | ||
71 | *--end = '/'; | ||
72 | } | ||
68 | namelen = strlen(base); | 73 | namelen = strlen(base); |
69 | /* Strip off excess slashes in base string */ | 74 | /* Strip off excess slashes in base string */ |
70 | while (namelen > 0 && base[namelen - 1] == '/') | 75 | while (namelen > 0 && base[namelen - 1] == '/') |