2013-01-29 05:16:23

by majianpeng

[permalink] [raw]
Subject: [PATCH 2/2] nfsd: Fix memleak.

V2hlbiBmcmVlIG5mcy1jbGllbnQsIGl0IG11c3QgZnJlZSB0aGUgLT5jbF9zdGF0ZWlkcy4NCg0K
U2lnbmVkLW9mZi1ieTogSmlhbnBlbmcgTWEgPG1hamlhbnBlbmdAZ21haWwuY29tPg0KLS0tDQog
ZnMvbmZzZC9uZnM0c3RhdGUuYyB8ICAgIDIgKysNCiAxIGZpbGUgY2hhbmdlZCwgMiBpbnNlcnRp
b25zKCspDQoNCmRpZmYgLS1naXQgYS9mcy9uZnNkL25mczRzdGF0ZS5jIGIvZnMvbmZzZC9uZnM0
c3RhdGUuYw0KaW5kZXggYWM4ZWQ5Ni4uYTgzMDljNiAxMDA2NDQNCi0tLSBhL2ZzL25mc2QvbmZz
NHN0YXRlLmMNCisrKyBiL2ZzL25mc2QvbmZzNHN0YXRlLmMNCkBAIC0xMDYwLDYgKzEwNjAsOCBA
QCBmcmVlX2NsaWVudChzdHJ1Y3QgbmZzNF9jbGllbnQgKmNscCkNCiAJfQ0KIAlmcmVlX3N2Y19j
cmVkKCZjbHAtPmNsX2NyZWQpOw0KIAlrZnJlZShjbHAtPmNsX25hbWUuZGF0YSk7DQorCWlkcl9y
ZW1vdmVfYWxsKCZjbHAtPmNsX3N0YXRlaWRzKTsNCisJaWRyX2Rlc3Ryb3koJmNscC0+Y2xfc3Rh
dGVpZHMpOw0KIAlrZnJlZShjbHApOw0KIH0NCiANCi0tIA0KMS43LjkuNQ0K



2013-01-29 22:29:27

by J. Bruce Fields

[permalink] [raw]
Subject: Re: [PATCH 2/2] nfsd: Fix memleak.

Tejun, maybe this could be added to your series?

(Or should I just take it without the idr_remove_all()?)

--b.

On Tue, Jan 29, 2013 at 01:16:06PM +0800, majianpeng wrote:
> When free nfs-client, it must free the ->cl_stateids.
>
> Signed-off-by: Jianpeng Ma <[email protected]>
> ---
> fs/nfsd/nfs4state.c | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/fs/nfsd/nfs4state.c b/fs/nfsd/nfs4state.c
> index ac8ed96..a8309c6 100644
> --- a/fs/nfsd/nfs4state.c
> +++ b/fs/nfsd/nfs4state.c
> @@ -1060,6 +1060,8 @@ free_client(struct nfs4_client *clp)
> }
> free_svc_cred(&clp->cl_cred);
> kfree(clp->cl_name.data);
> + idr_remove_all(&clp->cl_stateids);
> + idr_destroy(&clp->cl_stateids);
> kfree(clp);
> }
>
> --
> 1.7.9.5

2013-02-04 19:29:49

by Tejun Heo

[permalink] [raw]
Subject: Re: [PATCH 2/2] nfsd: Fix memleak.

Hello,

On Tue, Jan 29, 2013 at 05:29:26PM -0500, bfields wrote:
> Tejun, maybe this could be added to your series?
>
> (Or should I just take it without the idr_remove_all()?)

There are gonna be other related nfs changes anyway, so I think it
would be better to just route it through the usual nfs channel. We
can deal with conflicts / conversion later.

Thanks.

--
tejun

2013-02-05 14:43:18

by J. Bruce Fields

[permalink] [raw]
Subject: Re: [PATCH 2/2] nfsd: Fix memleak.

On Mon, Feb 04, 2013 at 11:29:44AM -0800, Tejun Heo wrote:
> Hello,
>
> On Tue, Jan 29, 2013 at 05:29:26PM -0500, bfields wrote:
> > Tejun, maybe this could be added to your series?
> >
> > (Or should I just take it without the idr_remove_all()?)
>
> There are gonna be other related nfs changes anyway, so I think it
> would be better to just route it through the usual nfs channel. We
> can deal with conflicts / conversion later.

Thanks, applying for 3.9.--b