]> git.ipfire.org Git - ipfire-2.x.git/blame - src/patches/suse-2.6.27.39/patches.fixes/nfs-04-Fix-nfs_path-to-always-return-a-slash-at-the-beginning-of-the-path
Imported linux-2.6.27.39 suse/xen patches.
[ipfire-2.x.git] / src / patches / suse-2.6.27.39 / patches.fixes / nfs-04-Fix-nfs_path-to-always-return-a-slash-at-the-beginning-of-the-path
CommitLineData
2cb7cef9
BS
1From 0b75b35c7cad33e7613f5adf28fa10fe8b09b1c3 Mon Sep 17 00:00:00 2001
2From: Trond Myklebust <Trond.Myklebust@netapp.com>
3Date: Mon, 22 Jun 2009 15:09:14 -0400
4Subject: [PATCH 4/5] NFS: Fix nfs_path() to always return a '/' at the beginning of the path
5
6Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
7Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
8Acked-by: NeilBrown <neilb@suse.de>
9---
10 fs/nfs/namespace.c | 5 +++++
11 1 file changed, 5 insertions(+)
12
13--- linux-2.6.27-SLE11_BRANCH.orig/fs/nfs/namespace.c
14+++ linux-2.6.27-SLE11_BRANCH/fs/nfs/namespace.c
15@@ -65,6 +65,11 @@ char *nfs_path(const char *base,
16 dentry = dentry->d_parent;
17 }
18 spin_unlock(&dcache_lock);
19+ if (*end != '/') {
20+ if (--buflen < 0)
21+ goto Elong;
22+ *--end = '/';
23+ }
24 namelen = strlen(base);
25 /* Strip off excess slashes in base string */
26 while (namelen > 0 && base[namelen - 1] == '/')