From 730ae5f0a08db85935657a51f0656b8cd630869d Mon Sep 17 00:00:00 2001 From: Benny Halevy Date: Wed, 12 May 2010 00:13:29 +0300 Subject: [PATCH] --- yaml --- r: 192380 b: refs/heads/master c: 46583e2597af649f134462d2f2c1be5e6689198d h: refs/heads/master v: v3 --- [refs] | 2 +- trunk/fs/nfsd/nfs4state.c | 4 +++- trunk/fs/nfsd/state.h | 2 ++ 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/[refs] b/[refs] index b7e52207ca1a..99c3e3935dcb 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 84d38ac9abf0a5bc0044c9363acaad55a9a4be0d +refs/heads/master: 46583e2597af649f134462d2f2c1be5e6689198d diff --git a/trunk/fs/nfsd/nfs4state.c b/trunk/fs/nfsd/nfs4state.c index dede43c37336..e439a882e0c2 100644 --- a/trunk/fs/nfsd/nfs4state.c +++ b/trunk/fs/nfsd/nfs4state.c @@ -740,8 +740,9 @@ expire_client(struct nfs4_client *clp) list_del(&clp->cl_strhash); spin_lock(&client_lock); unhash_client_locked(clp); + if (atomic_read(&clp->cl_refcount) == 0) + free_client(clp); spin_unlock(&client_lock); - free_client(clp); } static void copy_verf(struct nfs4_client *target, nfs4_verifier *source) @@ -827,6 +828,7 @@ static struct nfs4_client *create_client(struct xdr_netobj name, char *recdir, } memcpy(clp->cl_recdir, recdir, HEXDIR_LEN); + atomic_set(&clp->cl_refcount, 0); atomic_set(&clp->cl_cb_set, 0); INIT_LIST_HEAD(&clp->cl_idhash); INIT_LIST_HEAD(&clp->cl_strhash); diff --git a/trunk/fs/nfsd/state.h b/trunk/fs/nfsd/state.h index 98836fd87f69..ee42a0beecfa 100644 --- a/trunk/fs/nfsd/state.h +++ b/trunk/fs/nfsd/state.h @@ -233,6 +233,8 @@ struct nfs4_client { struct nfsd4_clid_slot cl_cs_slot; /* create_session slot */ u32 cl_exchange_flags; struct nfs4_sessionid cl_sessionid; + /* number of rpc's in progress over an associated session: */ + atomic_t cl_refcount; /* for nfs41 callbacks */ /* We currently support a single back channel with a single slot */