1 From b88f8a546f5dba213938fdfc11e66bc5c2421623 Mon Sep 17 00:00:00 2001
2 From: Trond Myklebust <Trond.Myklebust@netapp.com>
3 Date: Mon, 22 Jun 2009 15:09:14 -0400
4 Subject: [PATCH 5/5] NFS: Correct the NFS mount path when following a referral
6 Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
7 Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
8 Acked-by: NeilBrown <neilb@suse.de>
10 fs/nfs/super.c | 24 ++++++++++++++++++++++++
11 1 file changed, 24 insertions(+)
13 --- linux-2.6.27-SLE11_BRANCH.orig/fs/nfs/super.c
14 +++ linux-2.6.27-SLE11_BRANCH/fs/nfs/super.c
15 @@ -2420,6 +2420,27 @@ static struct vfsmount *nfs_do_root_moun
19 +static void nfs_fix_devname(const struct path *path, struct vfsmount *mnt)
21 + char *page = (char *) __get_free_page(GFP_KERNEL);
22 + char *devname, *tmp;
26 + devname = nfs_path(path->mnt->mnt_devname,
27 + path->mnt->mnt_root, path->dentry,
29 + if (devname == NULL)
31 + tmp = kstrdup(devname, GFP_KERNEL);
34 + kfree(mnt->mnt_devname);
35 + mnt->mnt_devname = tmp;
37 + free_page((unsigned long)page);
40 static int nfs_follow_remote_path(struct vfsmount *root_mnt,
41 const char *export_path, struct vfsmount *mnt_target)
43 @@ -2446,6 +2467,9 @@ static int nfs_follow_remote_path(struct
44 mnt_target->mnt_sb = s;
45 mnt_target->mnt_root = dget(nd.path.dentry);
47 + /* Correct the device pathname */
48 + nfs_fix_devname(&nd.path, mnt_target);
51 down_write(&s->s_umount);