From: Trond Myklebust Date: Mon, 22 Jun 2009 19:09:14 +0000 (-0400) Subject: NFS: Fix nfs_path() to always return a '/' at the beginning of the path X-Git-Url: http://git.mmlx.us/?a=commitdiff_plain;h=0b75b35c7cad33e7613f5adf28fa10fe8b09b1c3;p=linux-edison.git NFS: Fix nfs_path() to always return a '/' at the beginning of the path Signed-off-by: Trond Myklebust Signed-off-by: Linus Torvalds --- 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, 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] == '/')