]> git.karo-electronics.de Git - linux-beck.git/commitdiff
nfsd41: reclaim DRC memory on session free
authorAndy Adamson <andros@netapp.com>
Mon, 27 Jul 2009 22:49:05 +0000 (18:49 -0400)
committerJ. Bruce Fields <bfields@citi.umich.edu>
Tue, 28 Jul 2009 18:29:48 +0000 (14:29 -0400)
This fixes a leak which would eventually lock out new clients.

Signed-off-by: Andy Adamson <andros@netapp.com>
Signed-off-by: J. Bruce Fields <bfields@citi.umich.edu>
fs/nfsd/nfs4state.c

index 2e6a44e3d2fe21d935dede6d6906392514c97b21..69bd37e3fdcfdc4178a9bce8cf6d95f8315ddff4 100644 (file)
@@ -585,6 +585,9 @@ free_session(struct kref *kref)
                struct nfsd4_cache_entry *e = &ses->se_slots[i].sl_cache_entry;
                nfsd4_release_respages(e->ce_respages, e->ce_resused);
        }
+       spin_lock(&nfsd_drc_lock);
+       nfsd_drc_pages_used -= ses->se_fchannel.maxreqs * NFSD_PAGES_PER_SLOT;
+       spin_unlock(&nfsd_drc_lock);
        kfree(ses);
 }