]> git.baikalelectronics.ru Git - kernel.git/commit
nvme: flush namespace scanning work just before removing namespaces
authorSagi Grimberg <sagi@grimberg.me>
Wed, 21 Nov 2018 23:17:37 +0000 (15:17 -0800)
committerChristoph Hellwig <hch@lst.de>
Fri, 30 Nov 2018 16:23:23 +0000 (17:23 +0100)
commit4df11e5c21dffff07538207248671a650602cdb1
treecf7557ac6052f56b3d3f88892643f7d0d75c19be
parentdb1b2b4179a65183505ca3fa755b1be024686a76
nvme: flush namespace scanning work just before removing namespaces

nvme_stop_ctrl can be called also for reset flow and there is no need to
flush the scan_work as namespaces are not being removed. This can cause
deadlock in rdma, fc and loop drivers since nvme_stop_ctrl barriers
before controller teardown (and specifically I/O cancellation of the
scan_work itself) takes place, but the scan_work will be blocked anyways
so there is no need to flush it.

Instead, move scan_work flush to nvme_remove_namespaces() where it really
needs to flush.

Reported-by: Ming Lei <ming.lei@redhat.com>
Signed-off-by: Sagi Grimberg <sagi@grimberg.me>
Reviewed-by: Keith Busch <keith.busch@intel.com>
Reviewed by: James Smart <jsmart2021@gmail.com>
Tested-by: Ewan D. Milne <emilne@redhat.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
drivers/nvme/host/core.c