diff options
-rw-r--r-- | fs/nfsd/nfs4state.c | 4 | ||||
-rw-r--r-- | fs/nfsd/state.h | 2 |
2 files changed, 5 insertions, 1 deletions
diff --git a/fs/nfsd/nfs4state.c b/fs/nfsd/nfs4state.c index dede43c37336..e439a882e0c2 100644 --- a/fs/nfsd/nfs4state.c +++ b/fs/nfsd/nfs4state.c | |||
@@ -740,8 +740,9 @@ expire_client(struct nfs4_client *clp) | |||
740 | list_del(&clp->cl_strhash); | 740 | list_del(&clp->cl_strhash); |
741 | spin_lock(&client_lock); | 741 | spin_lock(&client_lock); |
742 | unhash_client_locked(clp); | 742 | unhash_client_locked(clp); |
743 | if (atomic_read(&clp->cl_refcount) == 0) | ||
744 | free_client(clp); | ||
743 | spin_unlock(&client_lock); | 745 | spin_unlock(&client_lock); |
744 | free_client(clp); | ||
745 | } | 746 | } |
746 | 747 | ||
747 | static void copy_verf(struct nfs4_client *target, nfs4_verifier *source) | 748 | 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, | |||
827 | } | 828 | } |
828 | 829 | ||
829 | memcpy(clp->cl_recdir, recdir, HEXDIR_LEN); | 830 | memcpy(clp->cl_recdir, recdir, HEXDIR_LEN); |
831 | atomic_set(&clp->cl_refcount, 0); | ||
830 | atomic_set(&clp->cl_cb_set, 0); | 832 | atomic_set(&clp->cl_cb_set, 0); |
831 | INIT_LIST_HEAD(&clp->cl_idhash); | 833 | INIT_LIST_HEAD(&clp->cl_idhash); |
832 | INIT_LIST_HEAD(&clp->cl_strhash); | 834 | INIT_LIST_HEAD(&clp->cl_strhash); |
diff --git a/fs/nfsd/state.h b/fs/nfsd/state.h index 98836fd87f69..ee42a0beecfa 100644 --- a/fs/nfsd/state.h +++ b/fs/nfsd/state.h | |||
@@ -233,6 +233,8 @@ struct nfs4_client { | |||
233 | struct nfsd4_clid_slot cl_cs_slot; /* create_session slot */ | 233 | struct nfsd4_clid_slot cl_cs_slot; /* create_session slot */ |
234 | u32 cl_exchange_flags; | 234 | u32 cl_exchange_flags; |
235 | struct nfs4_sessionid cl_sessionid; | 235 | struct nfs4_sessionid cl_sessionid; |
236 | /* number of rpc's in progress over an associated session: */ | ||
237 | atomic_t cl_refcount; | ||
236 | 238 | ||
237 | /* for nfs41 callbacks */ | 239 | /* for nfs41 callbacks */ |
238 | /* We currently support a single back channel with a single slot */ | 240 | /* We currently support a single back channel with a single slot */ |