[pnfs] [PATCH 4/5] add BUG_ONs to free_client()

Benny Halevy bhalevy at panasas.com
Thu May 17 09:46:36 EDT 2007


make sure the nfs4_client is unhashed and that nothing
hangs off of it before freeing the structure

Signed-off-by: Benny Halevy <bhalevy at panasas.com>
---
 fs/nfsd/nfs4state.c |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/fs/nfsd/nfs4state.c b/fs/nfsd/nfs4state.c
index baf55f5..916cb26 100644
--- a/fs/nfsd/nfs4state.c
+++ b/fs/nfsd/nfs4state.c
@@ -507,6 +507,11 @@ alloc_client(struct xdr_netobj name)
 static inline void
 free_client(struct nfs4_client *clp)
 {
+	BUG_ON(!list_empty(&clp->cl_idhash));
+	BUG_ON(!list_empty(&clp->cl_strhash));
+	BUG_ON(!list_empty(&clp->cl_lru));
+	BUG_ON(!list_empty(&clp->cl_delegations));
+	BUG_ON(!list_empty(&clp->cl_openowners));
 	if (clp->cl_cred.cr_group_info)
 		put_group_info(clp->cl_cred.cr_group_info);
 	kfree(clp->cl_name.data);



More information about the pNFS mailing list