[PATCHv2 0/5][RESEND] Fixup return value for nvme_submit_sync_cmd()

Keith Busch kbusch at kernel.org
Wed Jan 27 10:09:17 EST 2021


On Wed, Jan 27, 2021 at 11:33:21AM +0100, Hannes Reinecke wrote:
> Hi all,
> 
> here are some small patches for fixing up the return value of nvme_submit_sync_cmd().
> As Keith correctly noted, nvme_submit_sync_cmd() should be returning
> an error if the command could not be performed; however, currently
> only pci does that.
> So we need to fix up nvme_cancel_request() to return an -EINTR
> on any pending sync commands during reset.
> And modify nvme-fc to return the same nvme status after timing out
> or cancelling requests.
> Plus, finally, adding a new flag 'NVME_REQ_TIMEOUT' to indicate
> that a command had been aborted due to a timeout, and translates that
> back into -ETIMEDOUT as a return code for nvme_submit_sync_cmd().

Mostly looks good, but I'm not sure I understand the NVME_REQ_TIMEOUT
flag at the end. That appears to be serving the same purpose as the
"CANCELLED" flag, no?



More information about the Linux-nvme mailing list