OSDN Git Service

nvme-fc: correct io termination handling
authorJames Smart <jsmart2021@gmail.com>
Thu, 19 Oct 2017 23:11:38 +0000 (16:11 -0700)
committerChristoph Hellwig <hch@lst.de>
Fri, 20 Oct 2017 10:16:59 +0000 (12:16 +0200)
commit0a02e39fd1eb2ceb3dd0dc765cb2de4d09697a14
tree8eb3b9ef76b4461ad96e2a9771aae4c9e17df8c2
parenta7a7cbe353a52665b8463e1822ce6ba46b0609d6
nvme-fc: correct io termination handling

The io completion handling for i/o's that are failing due to
to a transport error or association termination had issues, causing
io failures (DNR set so retries didn't kick in) or long stalls.

Change the io completion handler for the following items:

When an io has been completed due to a transport abort (based on an
exchange error) or when marked as aborted as part of an association
termination (FCOP_FLAGS_TERMIO), set the NVME completion status to
NVME_SC_ABORTED. By default, do not set DNR on the status so that a
retry can be attempted after association recreate.

In cases where an io is failed (non-successful nvme status including
aborted), if the controller is being deleted (blk_queue_dying) or
the io was part of the ios used for association creation (ctrl state
is NEW or RECONNECTING), then additionally set the DNR bit so the io
will not be retried. If the failed io was part of association creation,
the failure will tear down the partially completioned association and
typically restart a new reconnect attempt (another create association
later).

Rearranged code flow to remove a largely unneeded local variable.

Signed-off-by: James Smart <james.smart@broadcom.com>
Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de>
Signed-off-by: Christoph Hellwig <hch@lst.de>
drivers/nvme/host/fc.c