diff options
author | 2009-06-22 15:09:14 -0400 | |
---|---|---|
committer | 2009-06-22 21:28:25 -0700 | |
commit | 0b75b35c7cad33e7613f5adf28fa10fe8b09b1c3 (patch) | |
tree | 92b9987a33dc791aed752469ea7aed6e00a63b36 /fs/nfs/namespace.c | |
parent | NFSv4: Replace nfs4_path_walk() with VFS path lookup in a private namespace (diff) | |
download | linux-0b75b35c7cad33e7613f5adf28fa10fe8b09b1c3.tar.gz linux-0b75b35c7cad33e7613f5adf28fa10fe8b09b1c3.tar.bz2 linux-0b75b35c7cad33e7613f5adf28fa10fe8b09b1c3.zip |
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>
Diffstat (limited to 'fs/nfs/namespace.c')
-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 f01caec84463..40c766782891 100644 --- a/fs/nfs/namespace.c +++ b/fs/nfs/namespace.c @@ -65,6 +65,11 @@ char *nfs_path(const char *base, dentry = dentry->d_parent; } spin_unlock(&dcache_lock); + if (*end != '/') { + if (--buflen < 0) + goto Elong; + *--end = '/'; + } namelen = strlen(base); /* Strip off excess slashes in base string */ while (namelen > 0 && base[namelen - 1] == '/') |