]> git.baikalelectronics.ru Git - kernel.git/commit
nvme-fc: fix rogue admin cmds stalling teardown
authorJames Smart <jsmart2021@gmail.com>
Thu, 11 Jan 2018 22:29:22 +0000 (14:29 -0800)
committerChristoph Hellwig <hch@lst.de>
Wed, 17 Jan 2018 16:54:49 +0000 (17:54 +0100)
commit0644d52bf2ffcba3c848677d261ace48834893fb
treef61f61386c7c0c111f8e3099a14c7306edaa4abc
parent6b23ff7b891f64cd163b8be7fd9dc71115916b54
nvme-fc: fix rogue admin cmds stalling teardown

When connectivity is lost to a device, the association is terminated
and the blk-mq queues are quiesced/stopped. When connectivity is
re-established, they are resumed.

If an admin command is received while connectivity is list, the ioctl
queues the command on the admin_q and the command stalls (the thread
issuing the ioctl hangs/waits). if the connectivity is lost long
enough such that the controller is then deleted, the delete code
makes its calls to initiate the delete, which then expects the core
layer to call the transport when all references are removed and the
controller can be freed.  Unfortunately, nothing in this path dequeued
the admin command, so a reference sits outstanding and things stop,
hanging the delete indefinitely.

Correct by unquiescing the admin queue in the delete association. This
means any admin command (which should only be from an ioctl) issued
after connectivity is lost will detect the controller is in a
reconnecting state and will (fast) fail the command. Thus, a pending
reference can no longer be created.  Once connectivity is re-established,
a new ioctl/admin command would see proper device state and function again.

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