]> git.baikalelectronics.ru Git - kernel.git/commit
nvme-fc: resolve io failures during connect
authorJames Smart <jsmart2021@gmail.com>
Thu, 15 Nov 2018 00:35:10 +0000 (16:35 -0800)
committerChristoph Hellwig <hch@lst.de>
Thu, 15 Nov 2018 10:37:55 +0000 (11:37 +0100)
commit1b222cfa85eda6f8d1a34501537b67cb3082dfbc
treeb250b7a408e8ffb1a51346fca54301d76aaebf22
parent73062e40f5291474ac440cbd7b1c849970a530e2
nvme-fc: resolve io failures during connect

If an io error occurs on an io issued while connecting, recovery
of the io falls flat as the state checking ends up nooping the error
handler.

Create an err_work work item that is scheduled upon an io error while
connecting. The work thread terminates all io on all queues and marks
the queues as not connected.  The termination of the io will return
back to the callee, which will then back out of the connection attempt
and will reschedule, if possible, the connection attempt.

The changes:
- in case there are several commands hitting the error handler, a
  state flag is kept so that the error work is only scheduled once,
  on the first error. The subsequent errors can be ignored.
- The calling sequence to stop keep alive and terminate the queues
  and their io is lifted from the reset routine. Made a small
  service routine used by both reset and err_work.
- During debugging, found that the teardown path can reference
  an uninitialized pointer, resulting in a NULL pointer oops.
  The aen_ops weren't initialized yet. Add validation on their
  initialization before calling the teardown routine.

Signed-off-by: James Smart <jsmart2021@gmail.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
drivers/nvme/host/fc.c