]> git.kernelconcepts.de Git - karo-tx-linux.git/blobdiff - fs/nfsd/nfs4xdr.c
nfsd4: allow destroy_session over destroyed session
[karo-tx-linux.git] / fs / nfsd / nfs4xdr.c
index c102d2509a2a86903c172e4e750cf9e03df5b809..0c0f3ea90de59f9c9e0c21aebd46e8b07b2f45f9 100644 (file)
@@ -3760,13 +3760,17 @@ nfs4svc_encode_compoundres(struct svc_rqst *rqstp, __be32 *p, struct nfsd4_compo
        iov->iov_len = ((char*)resp->p) - (char*)iov->iov_base;
        BUG_ON(iov->iov_len > PAGE_SIZE);
        if (nfsd4_has_session(cs)) {
+               struct nfsd_net *nn = net_generic(SVC_NET(rqstp), nfsd_net_id);
+               struct nfs4_client *clp = cs->session->se_client;
                if (cs->status != nfserr_replay_cache) {
                        nfsd4_store_cache_entry(resp);
                        cs->slot->sl_flags &= ~NFSD4_SLOT_INUSE;
                }
                /* Renew the clientid on success and on replay */
-               put_client_renew(cs->session->se_client);
+               spin_lock(&nn->client_lock);
                nfsd4_put_session(cs->session);
+               spin_unlock(&nn->client_lock);
+               put_client_renew(clp);
        }
        return 1;
 }