Skip to contentSkip to conversation

nfsd4: fix nfs4 stateid leak

PATCH New J. Bruce Fields 1 participant 1 message Sep 10, 2012

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 nfsd4: fix nfs4 stateid leak

From: "J. Bruce Fields" <[email protected]>

Processes that open and close multiple files may end up setting this oo_last_closed_stid without freeing what was previously pointed to. This can result in a major leak, visible for example by watching the nfsd4_stateids line of /proc/slabinfo.

---
 fs/nfsd/nfs4state.c |    1 +
 1 file changed, 1 insertion(+)

Queuing up for 3.7 and -stable.--b.

fs/nfsd/nfs4state.c +1 -0
index 5f1a91a..6686e74 100644
@@ -3766,6 +3766,7 @@ nfsd4_close(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate,
 	memcpy(&close->cl_stateid, &stp->st_stid.sc_stateid, sizeof(stateid_t));
 
 	nfsd4_close_open_stateid(stp);
+	release_last_closed_stateid(oo);
 	oo->oo_last_closed_stid = stp;
 
 	if (list_empty(&oo->oo_owner.so_stateids)) {
Signature · 1 line
1.7.9.5