aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--fs/nfsd/nfs4state.c12
-rw-r--r--fs/nfsd/nfs4xdr.c1
-rw-r--r--fs/nfsd/state.h2
3 files changed, 8 insertions, 7 deletions
diff --git a/fs/nfsd/nfs4state.c b/fs/nfsd/nfs4state.c
index 2e27430b9070..3e5cbfe8a967 100644
--- a/fs/nfsd/nfs4state.c
+++ b/fs/nfsd/nfs4state.c
@@ -864,7 +864,7 @@ static void free_session(struct kref *kref)
864 __free_session(ses); 864 __free_session(ses);
865} 865}
866 866
867void nfsd4_put_session(struct nfsd4_session *ses) 867static void nfsd4_put_session(struct nfsd4_session *ses)
868{ 868{
869 struct nfsd_net *nn = net_generic(ses->se_client->net, nfsd_net_id); 869 struct nfsd_net *nn = net_generic(ses->se_client->net, nfsd_net_id);
870 870
@@ -1057,12 +1057,16 @@ release_session_client(struct nfsd4_session *session)
1057 struct nfs4_client *clp = session->se_client; 1057 struct nfs4_client *clp = session->se_client;
1058 struct nfsd_net *nn = net_generic(clp->net, nfsd_net_id); 1058 struct nfsd_net *nn = net_generic(clp->net, nfsd_net_id);
1059 1059
1060 nfsd4_put_session(session);
1060 if (!atomic_dec_and_lock(&clp->cl_refcount, &nn->client_lock)) 1061 if (!atomic_dec_and_lock(&clp->cl_refcount, &nn->client_lock))
1061 return; 1062 return;
1062 if (is_client_expired(clp)) { 1063 /*
1064 * At this point we also know all sessions have refcnt 1,
1065 * so free_client will delete them all if necessary:
1066 */
1067 if (is_client_expired(clp))
1063 free_client(clp); 1068 free_client(clp);
1064 session->se_client = NULL; 1069 else
1065 } else
1066 renew_client_locked(clp); 1070 renew_client_locked(clp);
1067 spin_unlock(&nn->client_lock); 1071 spin_unlock(&nn->client_lock);
1068} 1072}
diff --git a/fs/nfsd/nfs4xdr.c b/fs/nfsd/nfs4xdr.c
index 229b3ac246e1..9b02b6652f2b 100644
--- a/fs/nfsd/nfs4xdr.c
+++ b/fs/nfsd/nfs4xdr.c
@@ -3685,7 +3685,6 @@ nfs4svc_encode_compoundres(struct svc_rqst *rqstp, __be32 *p, struct nfsd4_compo
3685 } 3685 }
3686 /* Renew the clientid on success and on replay */ 3686 /* Renew the clientid on success and on replay */
3687 release_session_client(cs->session); 3687 release_session_client(cs->session);
3688 nfsd4_put_session(cs->session);
3689 } 3688 }
3690 return 1; 3689 return 1;
3691} 3690}
diff --git a/fs/nfsd/state.h b/fs/nfsd/state.h
index 1a8c7391f7ae..327552bb6dba 100644
--- a/fs/nfsd/state.h
+++ b/fs/nfsd/state.h
@@ -209,8 +209,6 @@ struct nfsd4_session {
209 struct nfsd4_slot *se_slots[]; /* forward channel slots */ 209 struct nfsd4_slot *se_slots[]; /* forward channel slots */
210}; 210};
211 211
212extern void nfsd4_put_session(struct nfsd4_session *ses);
213
214/* formatted contents of nfs4_sessionid */ 212/* formatted contents of nfs4_sessionid */
215struct nfsd4_sessionid { 213struct nfsd4_sessionid {
216 clientid_t clientid; 214 clientid_t clientid;