diff options
author | J. Bruce Fields <bfields@redhat.com> | 2012-08-29 18:21:58 -0400 |
---|---|---|
committer | J. Bruce Fields <bfields@redhat.com> | 2012-09-10 10:55:14 -0400 |
commit | cf9182e90b2af04245ac4fae497fe73fc71285b4 (patch) | |
tree | a4659b22d9d2b35a168cbcf7f7c057412129d0c1 /fs/nfsd | |
parent | 8a4c6e19cfed5e650045312affed7e6056383278 (diff) |
nfsd4: fix nfs4 stateid leak
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@excellency.fr>
Tested-by: Cyril B. <cbay@excellency.fr>
Cc: stable@vger.kernel.org
Signed-off-by: J. Bruce Fields <bfields@redhat.com>
Diffstat (limited to 'fs/nfsd')
-rw-r--r-- | fs/nfsd/nfs4state.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/fs/nfsd/nfs4state.c b/fs/nfsd/nfs4state.c index 5f1a91a9cd35..6686e747223f 100644 --- a/fs/nfsd/nfs4state.c +++ b/fs/nfsd/nfs4state.c | |||
@@ -3766,6 +3766,7 @@ nfsd4_close(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate, | |||
3766 | memcpy(&close->cl_stateid, &stp->st_stid.sc_stateid, sizeof(stateid_t)); | 3766 | memcpy(&close->cl_stateid, &stp->st_stid.sc_stateid, sizeof(stateid_t)); |
3767 | 3767 | ||
3768 | nfsd4_close_open_stateid(stp); | 3768 | nfsd4_close_open_stateid(stp); |
3769 | release_last_closed_stateid(oo); | ||
3769 | oo->oo_last_closed_stid = stp; | 3770 | oo->oo_last_closed_stid = stp; |
3770 | 3771 | ||
3771 | if (list_empty(&oo->oo_owner.so_stateids)) { | 3772 | if (list_empty(&oo->oo_owner.so_stateids)) { |