aboutsummaryrefslogtreecommitdiffstats
path: root/fs/nfs/getroot.c
diff options
context:
space:
mode:
authorKinglong Mee <kinglongmee@gmail.com>2014-04-15 17:22:59 +0800
committerTrond Myklebust <trond.myklebust@primarydata.com>2014-04-15 10:29:25 -0400
commit4dfc7fdb9e261d77818616782ae1841a80e0fc83 (patch)
treef678be3838e7865e79adb45fc248ed6a97886b19 /fs/nfs/getroot.c
parentLinux 3.15-rc1 (diff)
downloadlinux-dev-4dfc7fdb9e261d77818616782ae1841a80e0fc83.tar.xz
linux-dev-4dfc7fdb9e261d77818616782ae1841a80e0fc83.zip
NFS: Fix memroy leak for double mounts
When double mounting same nfs filesystem, the devname saved in d_fsdata will be lost.The second mount should not change the devname that be saved in d_fsdata. Signed-off-by: Kinglong Mee <kinglongmee@gmail.com> Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com>
Diffstat (limited to 'fs/nfs/getroot.c')
-rw-r--r--fs/nfs/getroot.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/fs/nfs/getroot.c b/fs/nfs/getroot.c
index 66984a9aafaa..b94f80420a58 100644
--- a/fs/nfs/getroot.c
+++ b/fs/nfs/getroot.c
@@ -120,7 +120,8 @@ struct dentry *nfs_get_root(struct super_block *sb, struct nfs_fh *mntfh,
security_d_instantiate(ret, inode);
spin_lock(&ret->d_lock);
- if (IS_ROOT(ret) && !(ret->d_flags & DCACHE_NFSFS_RENAMED)) {
+ if (IS_ROOT(ret) && !ret->d_fsdata &&
+ !(ret->d_flags & DCACHE_NFSFS_RENAMED)) {
ret->d_fsdata = name;
name = NULL;
}