mirror of
https://github.com/adulau/aha.git
synced 2024-12-27 19:26:25 +00:00
nfsd4.1: fix session memory use calculation
Unbalanced calculations on creation and destruction of sessions could cause our estimate of cache memory used to become negative, sometimes resulting in spurious SERVERFAULT returns to client CREATE_SESSION requests. Signed-off-by: J. Bruce Fields <bfields@citi.umich.edu>
This commit is contained in:
parent
dc7a08166f
commit
dd829c4564
1 changed files with 4 additions and 1 deletions
|
@ -629,10 +629,13 @@ void
|
|||
free_session(struct kref *kref)
|
||||
{
|
||||
struct nfsd4_session *ses;
|
||||
int mem;
|
||||
|
||||
ses = container_of(kref, struct nfsd4_session, se_ref);
|
||||
spin_lock(&nfsd_drc_lock);
|
||||
nfsd_drc_mem_used -= ses->se_fchannel.maxreqs * NFSD_SLOT_CACHE_SIZE;
|
||||
mem = ses->se_fchannel.maxreqs
|
||||
* (ses->se_fchannel.maxresp_cached - NFSD_MIN_HDR_SEQ_SZ);
|
||||
nfsd_drc_mem_used -= mem;
|
||||
spin_unlock(&nfsd_drc_lock);
|
||||
free_session_slots(ses);
|
||||
kfree(ses);
|
||||
|
|
Loading…
Reference in a new issue