Loading fs/nfsd/nfs4proc.c +1 −1 Original line number Diff line number Diff line Loading @@ -1645,7 +1645,7 @@ static struct nfsd4_operation nfsd4_ops[] = { .op_name = "OP_SEQUENCE", }, [OP_DESTROY_CLIENTID] = { .op_func = NULL, .op_func = (nfsd4op_func)nfsd4_destroy_clientid, .op_flags = ALLOWED_WITHOUT_FH | ALLOWED_AS_FIRST_OP | OP_MODIFIES_SOMETHING, .op_name = "OP_DESTROY_CLIENTID", Loading fs/nfsd/nfs4state.c +44 −0 Original line number Diff line number Diff line Loading @@ -1962,6 +1962,50 @@ out: return status; } static inline bool has_resources(struct nfs4_client *clp) { return !list_empty(&clp->cl_openowners) || !list_empty(&clp->cl_delegations) || !list_empty(&clp->cl_sessions); } __be32 nfsd4_destroy_clientid(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate, struct nfsd4_destroy_clientid *dc) { struct nfs4_client *conf, *unconf, *clp; int status = 0; nfs4_lock_state(); unconf = find_unconfirmed_client(&dc->clientid); conf = find_confirmed_client(&dc->clientid); if (conf) { clp = conf; if (!is_client_expired(conf) && has_resources(conf)) { status = nfserr_clientid_busy; goto out; } /* rfc5661 18.50.3 */ if (cstate->session && conf == cstate->session->se_client) { status = nfserr_clientid_busy; goto out; } } else if (unconf) clp = unconf; else { status = nfserr_stale_clientid; goto out; } expire_client(clp); out: nfs4_unlock_state(); dprintk("%s return %d\n", __func__, ntohl(status)); return status; } __be32 nfsd4_reclaim_complete(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate, struct nfsd4_reclaim_complete *rc) { Loading fs/nfsd/nfs4xdr.c +11 −1 Original line number Diff line number Diff line Loading @@ -1417,6 +1417,16 @@ xdr_error: goto out; } static __be32 nfsd4_decode_destroy_clientid(struct nfsd4_compoundargs *argp, struct nfsd4_destroy_clientid *dc) { DECODE_HEAD; READ_BUF(8); COPYMEM(&dc->clientid, 8); DECODE_TAIL; } static __be32 nfsd4_decode_reclaim_complete(struct nfsd4_compoundargs *argp, struct nfsd4_reclaim_complete *rc) { DECODE_HEAD; Loading Loading @@ -1538,7 +1548,7 @@ static nfsd4_dec nfsd41_dec_ops[] = { [OP_SET_SSV] = (nfsd4_dec)nfsd4_decode_notsupp, [OP_TEST_STATEID] = (nfsd4_dec)nfsd4_decode_test_stateid, [OP_WANT_DELEGATION] = (nfsd4_dec)nfsd4_decode_notsupp, [OP_DESTROY_CLIENTID] = (nfsd4_dec)nfsd4_decode_notsupp, [OP_DESTROY_CLIENTID] = (nfsd4_dec)nfsd4_decode_destroy_clientid, [OP_RECLAIM_COMPLETE] = (nfsd4_dec)nfsd4_decode_reclaim_complete, }; Loading fs/nfsd/xdr4.h +5 −0 Original line number Diff line number Diff line Loading @@ -398,6 +398,10 @@ struct nfsd4_destroy_session { struct nfs4_sessionid sessionid; }; struct nfsd4_destroy_clientid { clientid_t clientid; }; struct nfsd4_reclaim_complete { u32 rca_one_fs; }; Loading Loading @@ -552,6 +556,7 @@ extern __be32 nfsd4_sequence(struct svc_rqst *, extern __be32 nfsd4_destroy_session(struct svc_rqst *, struct nfsd4_compound_state *, struct nfsd4_destroy_session *); extern __be32 nfsd4_destroy_clientid(struct svc_rqst *, struct nfsd4_compound_state *, struct nfsd4_destroy_clientid *); __be32 nfsd4_reclaim_complete(struct svc_rqst *, struct nfsd4_compound_state *, struct nfsd4_reclaim_complete *); extern __be32 nfsd4_process_open1(struct nfsd4_compound_state *, struct nfsd4_open *open); Loading Loading
fs/nfsd/nfs4proc.c +1 −1 Original line number Diff line number Diff line Loading @@ -1645,7 +1645,7 @@ static struct nfsd4_operation nfsd4_ops[] = { .op_name = "OP_SEQUENCE", }, [OP_DESTROY_CLIENTID] = { .op_func = NULL, .op_func = (nfsd4op_func)nfsd4_destroy_clientid, .op_flags = ALLOWED_WITHOUT_FH | ALLOWED_AS_FIRST_OP | OP_MODIFIES_SOMETHING, .op_name = "OP_DESTROY_CLIENTID", Loading
fs/nfsd/nfs4state.c +44 −0 Original line number Diff line number Diff line Loading @@ -1962,6 +1962,50 @@ out: return status; } static inline bool has_resources(struct nfs4_client *clp) { return !list_empty(&clp->cl_openowners) || !list_empty(&clp->cl_delegations) || !list_empty(&clp->cl_sessions); } __be32 nfsd4_destroy_clientid(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate, struct nfsd4_destroy_clientid *dc) { struct nfs4_client *conf, *unconf, *clp; int status = 0; nfs4_lock_state(); unconf = find_unconfirmed_client(&dc->clientid); conf = find_confirmed_client(&dc->clientid); if (conf) { clp = conf; if (!is_client_expired(conf) && has_resources(conf)) { status = nfserr_clientid_busy; goto out; } /* rfc5661 18.50.3 */ if (cstate->session && conf == cstate->session->se_client) { status = nfserr_clientid_busy; goto out; } } else if (unconf) clp = unconf; else { status = nfserr_stale_clientid; goto out; } expire_client(clp); out: nfs4_unlock_state(); dprintk("%s return %d\n", __func__, ntohl(status)); return status; } __be32 nfsd4_reclaim_complete(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate, struct nfsd4_reclaim_complete *rc) { Loading
fs/nfsd/nfs4xdr.c +11 −1 Original line number Diff line number Diff line Loading @@ -1417,6 +1417,16 @@ xdr_error: goto out; } static __be32 nfsd4_decode_destroy_clientid(struct nfsd4_compoundargs *argp, struct nfsd4_destroy_clientid *dc) { DECODE_HEAD; READ_BUF(8); COPYMEM(&dc->clientid, 8); DECODE_TAIL; } static __be32 nfsd4_decode_reclaim_complete(struct nfsd4_compoundargs *argp, struct nfsd4_reclaim_complete *rc) { DECODE_HEAD; Loading Loading @@ -1538,7 +1548,7 @@ static nfsd4_dec nfsd41_dec_ops[] = { [OP_SET_SSV] = (nfsd4_dec)nfsd4_decode_notsupp, [OP_TEST_STATEID] = (nfsd4_dec)nfsd4_decode_test_stateid, [OP_WANT_DELEGATION] = (nfsd4_dec)nfsd4_decode_notsupp, [OP_DESTROY_CLIENTID] = (nfsd4_dec)nfsd4_decode_notsupp, [OP_DESTROY_CLIENTID] = (nfsd4_dec)nfsd4_decode_destroy_clientid, [OP_RECLAIM_COMPLETE] = (nfsd4_dec)nfsd4_decode_reclaim_complete, }; Loading
fs/nfsd/xdr4.h +5 −0 Original line number Diff line number Diff line Loading @@ -398,6 +398,10 @@ struct nfsd4_destroy_session { struct nfs4_sessionid sessionid; }; struct nfsd4_destroy_clientid { clientid_t clientid; }; struct nfsd4_reclaim_complete { u32 rca_one_fs; }; Loading Loading @@ -552,6 +556,7 @@ extern __be32 nfsd4_sequence(struct svc_rqst *, extern __be32 nfsd4_destroy_session(struct svc_rqst *, struct nfsd4_compound_state *, struct nfsd4_destroy_session *); extern __be32 nfsd4_destroy_clientid(struct svc_rqst *, struct nfsd4_compound_state *, struct nfsd4_destroy_clientid *); __be32 nfsd4_reclaim_complete(struct svc_rqst *, struct nfsd4_compound_state *, struct nfsd4_reclaim_complete *); extern __be32 nfsd4_process_open1(struct nfsd4_compound_state *, struct nfsd4_open *open); Loading