[ 3.5.yuz extended stable ] Patch "nfsd4: fix nfs4 stateid leak" has been added to staging queue

Herton Ronaldo Krzesinski herton.krzesinski at canonical.com
Thu Nov 15 06:01:15 UTC 2012

This is a note to let you know that I have just added a patch titled

    nfsd4: fix nfs4 stateid leak

to the linux-3.5.y-queue branch of the 3.5.yuz extended stable tree 
which can be found at:


If you, or anyone else, feels it should not be added to this tree, please 
reply to this email.

For more information about the 3.5.yuz tree, see



>From 44ae26e4035d3119acfc135e9ed68e8eaf1abb4f Mon Sep 17 00:00:00 2001
From: "J. Bruce Fields" <bfields at redhat.com>
Date: Wed, 29 Aug 2012 15:21:58 -0700
Subject: [PATCH] nfsd4: fix nfs4 stateid leak

commit cf9182e90b2af04245ac4fae497fe73fc71285b4 upstream.

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.

Reported-by: Cyril B. <cbay at excellency.fr>
Tested-by: Cyril B. <cbay at excellency.fr>
Signed-off-by: J. Bruce Fields <bfields at redhat.com>
Signed-off-by: Herton Ronaldo Krzesinski <herton.krzesinski at canonical.com>
 fs/nfsd/nfs4state.c |    1 +
 1 file changed, 1 insertion(+)

diff --git a/fs/nfsd/nfs4state.c b/fs/nfsd/nfs4state.c
index e8ead04..be324aa 100644
--- a/fs/nfsd/nfs4state.c
+++ b/fs/nfsd/nfs4state.c
@@ -3748,6 +3748,7 @@ nfsd4_close(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate,
 	memcpy(&close->cl_stateid, &stp->st_stid.sc_stateid, sizeof(stateid_t));

+	release_last_closed_stateid(oo);
 	oo->oo_last_closed_stid = stp;

 	/* place unused nfs4_stateowners on so_close_lru list to be

More information about the kernel-team mailing list