[PATCH 0/2] Fixup return value for nvme_submit_sync_cmd()

Hannes Reinecke hare at suse.de
Wed Jan 27 03:06:03 EST 2021


Hi all,

here are two 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 the first patch fixes up nvme_cancel_request() to return an -EINTR
on any pending sync commands during reset.
And the second patch adds 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().

As usual, comments and reviews are welcome.

Hannes Reinecke (2):
  nvme: add NVME_REQ_CANCELLED flag in nvme_cancel_request()
  nvme: return -ETIMEDOUT in nvme_submit_sync_cmd()

 drivers/nvme/host/core.c | 3 +++
 drivers/nvme/host/nvme.h | 1 +
 drivers/nvme/host/rdma.c | 1 +
 drivers/nvme/host/tcp.c  | 1 +
 4 files changed, 6 insertions(+)

-- 
2.29.2




More information about the Linux-nvme mailing list