On 6/27/2022 8:16 PM, Keith Busch wrote: > On Mon, Jun 27, 2022 at 04:43:35PM -0700, Bart Van Assche wrote: >> @@ -854,6 +854,12 @@ static inline blk_status_t nvme_setup_rw(struct nvme_ns *ns, >> if (req->cmd_flags & REQ_RAHEAD) >> dsmgmt |= NVME_RW_DSM_FREQ_PREFETCH; >> >> + if (blk_queue_pipeline_zoned_writes(req->q) && >> + blk_rq_is_seq_zone_write(req)) >> + nvme_req(req)->max_retries = >> + min(0UL + type_max(typeof(nvme_req(req)->max_retries)), >> + nvme_req(req)->max_retries + req->q->nr_requests); > > I can't make much sense of what the above is trying to accomplish. This > reevaluates max_retries every time the request is retried, and the new > max_retries is based on the previous max_retries? I also had a hard time quickly reading the code but that maybe just me. Perhaps a well documented comment or a helper with comment explaining the logic will be helpful here ? -ck