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>
This commit is contained in:
Trond Myklebust 2009-06-22 15:09:14 -04:00 committed by Linus Torvalds
parent c02d7adf8c
commit 0b75b35c7c
1 changed files with 5 additions and 0 deletions

View File

@ -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] == '/')