diff options
author | J. Bruce Fields <bfields@redhat.com> | 2012-08-30 02:21:58 +0400 |
---|---|---|
committer | Ben Hutchings <ben@decadent.org.uk> | 2012-10-31 03:26:36 +0400 |
commit | f42ce0ca9eaf8a71f95dd0909c3ade7ab9cd824d (patch) | |
tree | d6e503a03d4660b0719ebe76f7864cc0197f8992 /fs/nfsd | |
parent | 414f1c99192dafc1d09e0188c1481ef722fe05d6 (diff) | |
download | linux-f42ce0ca9eaf8a71f95dd0909c3ade7ab9cd824d.tar.xz |
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@excellency.fr>
Tested-by: Cyril B. <cbay@excellency.fr>
Signed-off-by: J. Bruce Fields <bfields@redhat.com>
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
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 4cfe2601f4d0..d225b51a4a68 100644 --- a/fs/nfsd/nfs4state.c +++ b/fs/nfsd/nfs4state.c @@ -3673,6 +3673,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; /* place unused nfs4_stateowners on so_close_lru list to be |