Skip to content

Commit

Permalink
NFS: Fix nfs_path() to always return a '/' at the beginning of the path
Browse files Browse the repository at this point in the history
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
  • Loading branch information
Trond Myklebust authored and Linus Torvalds committed Jun 23, 2009
1 parent c02d7ad commit 0b75b35
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions fs/nfs/namespace.c
Original file line number Diff line number Diff line change
Expand Up @@ -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] == '/')
Expand Down

0 comments on commit 0b75b35

Please sign in to comment.