* [PATCH] nfsd: fix bug on nfs4 stateid deallocation
@ 2013-03-11 0:29 ycnian
0 siblings, 0 replies; only message in thread
From: ycnian @ 2013-03-11 0:29 UTC (permalink / raw)
To: bfields; +Cc: linux-kernel, linux-nfs
NFS4_OO_PURGE_CLOSE is not handled properly. To avoid memory leak, nfs4
stateid which is pointed by oo_last_closed_stid is freed in nfsd4_close(),
but NFS4_OO_PURGE_CLOSE isn't cleared meanwhile. So the stateid released
in THIS close procedure may be freed immediately in the coming encoding
function.
---
fs/nfsd/nfs4state.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/fs/nfsd/nfs4state.c b/fs/nfsd/nfs4state.c
index 75c873d..7499c91 100644
--- a/fs/nfsd/nfs4state.c
+++ b/fs/nfsd/nfs4state.c
@@ -3850,6 +3850,7 @@ nfsd4_close(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate,
nfsd4_close_open_stateid(stp);
release_last_closed_stateid(oo);
+ oo->oo_flags &= ~NFS4_OO_PURGE_CLOSE;
oo->oo_last_closed_stid = stp;
if (list_empty(&oo->oo_owner.so_stateids)) {
--
1.8.0.1
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2013-03-11 0:41 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-03-11 0:29 [PATCH] nfsd: fix bug on nfs4 stateid deallocation ycnian
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).