On 9/14/21 9:06 AM, Sagi Grimberg wrote: >>>> @@ -361,11 +366,13 @@ static inline void nvme_end_req(struct request >>>> *req) >>>> void nvme_complete_rq(struct request *req) >>>> { >>>> + struct nvme_ctrl *ctrl = nvme_req(req)->ctrl; >>>> + >>>> trace_nvme_complete_rq(req); >>>> nvme_cleanup_cmd(req); >>>> - if (nvme_req(req)->ctrl->kas) >>>> - nvme_req(req)->ctrl->comp_seen = true; >>>> + if (ctrl->kas) >>>> + ctrl->comp_seen = true; >>>> switch (nvme_decide_disposition(req)) { >>>> case COMPLETE: >>>> @@ -377,6 +384,15 @@ void nvme_complete_rq(struct request *req) >>>> case FAILOVER: >>>> nvme_failover_req(req); >>>> return; >>>> + case AUTHENTICATE: >>>> +#ifdef CONFIG_NVME_AUTH >>>> + if (nvme_change_ctrl_state(ctrl, NVME_CTRL_RESETTING)) >>>> + queue_work(nvme_wq, &ctrl->dhchap_auth_work); >>> >>> Why is the state change here and not in nvme_dhchap_auth_work? >>> >> Because switching to 'resetting' is an easy way to synchronize with the >> admin queue. > > Maybe fold this into nvme_authenticate_ctrl? in case someone adds/moves > this in the future and forgets the ctrl state serialization? Yeah; not a bad idea. Will be looking into it. Cheers, Hannes -- Dr. Hannes Reinecke Kernel Storage Architect hare@xxxxxxx +49 911 74053 688 SUSE Software Solutions Germany GmbH, Maxfeldstr. 5, 90409 Nürnberg HRB 36809 (AG Nürnberg), GF: Felix Imendörffer