]> git.baikalelectronics.ru Git - kernel.git/commit
nvme-fc: fix racing controller reset and create association
authorJames Smart <jsmart2021@gmail.com>
Tue, 9 Mar 2021 00:51:26 +0000 (16:51 -0800)
committerChristoph Hellwig <hch@lst.de>
Thu, 11 Mar 2021 10:48:35 +0000 (11:48 +0100)
commit0a0b64bfb83abe1c40956915249958c5b1d2ea31
treef018f2427cba5acffc7f0199d04e1f3cb6c9edb2
parent942222efdbc3e98b601b9b97ee91c94116da13e5
nvme-fc: fix racing controller reset and create association

Recent patch to prevent calling __nvme_fc_abort_outstanding_ios in
interrupt context results in a possible race condition. A controller
reset results in errored io completions, which schedules error
work. The change of error work to a work element allows it to fire
after the ctrl state transition to NVME_CTRL_CONNECTING, causing
any outstanding io (used to initialize the controller) to fail and
cause problems for connect_work.

Add a state check to only schedule error work if not in the RESETTING
state.

Fixes: a91839ff44a6 ("nvme-fc: avoid calling _nvme_fc_abort_outstanding_ios from interrupt context")
Signed-off-by: Nigel Kirkland <nkirkland2304@gmail.com>
Signed-off-by: James Smart <jsmart2021@gmail.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
drivers/nvme/host/fc.c