* [PATCH] NFS: Fix memroy leak for double mounts
@ 2014-04-15 9:22 Kinglong Mee
2014-04-15 14:27 ` Trond Myklebust
0 siblings, 1 reply; 2+ messages in thread
From: Kinglong Mee @ 2014-04-15 9:22 UTC (permalink / raw)
To: Trond Myklebust, Alexander Viro; +Cc: linux-nfs
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>
---
fs/nfs/getroot.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/fs/nfs/getroot.c b/fs/nfs/getroot.c
index 66984a9..b94f804 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;
}
--
1.9.0
^ permalink raw reply related [flat|nested] 2+ messages in thread* Re: [PATCH] NFS: Fix memroy leak for double mounts
2014-04-15 9:22 [PATCH] NFS: Fix memroy leak for double mounts Kinglong Mee
@ 2014-04-15 14:27 ` Trond Myklebust
0 siblings, 0 replies; 2+ messages in thread
From: Trond Myklebust @ 2014-04-15 14:27 UTC (permalink / raw)
To: Kinglong Mee; +Cc: Alexander Viro, linux-nfs
On Tue, 2014-04-15 at 17:22 +0800, Kinglong Mee wrote:
> 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>
> ---
> fs/nfs/getroot.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/fs/nfs/getroot.c b/fs/nfs/getroot.c
> index 66984a9..b94f804 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;
> }
Applied. Thanks!
--
Trond Myklebust
Linux NFS client maintainer, PrimaryData
trond.myklebust@primarydata.com
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2014-04-15 14:27 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-04-15 9:22 [PATCH] NFS: Fix memroy leak for double mounts Kinglong Mee
2014-04-15 14:27 ` Trond Myklebust
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.