]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commit
nvme_fc: add module to ops template to allow module references
authorJames Smart <jsmart2021@gmail.com>
Thu, 14 Nov 2019 23:15:26 +0000 (15:15 -0800)
committerKhalid Elmously <khalid.elmously@canonical.com>
Wed, 29 Jan 2020 04:47:27 +0000 (23:47 -0500)
commit8c30c08b2648e04193d0c68bde08a8e443d5a355
tree54ae8ce887e8201b7c2a1caea8ee4c5069174467
parenta935a44ed3ac388466707558202c8d1db0531ebc
nvme_fc: add module to ops template to allow module references

BugLink: https://bugs.launchpad.net/bugs/1860602
[ Upstream commit 863fbae929c7a5b64e96b8a3ffb34a29eefb9f8f ]

In nvme-fc: it's possible to have connected active controllers
and as no references are taken on the LLDD, the LLDD can be
unloaded.  The controller would enter a reconnect state and as
long as the LLDD resumed within the reconnect timeout, the
controller would resume.  But if a namespace on the controller
is the root device, allowing the driver to unload can be problematic.
To reload the driver, it may require new io to the boot device,
and as it's no longer connected we get into a catch-22 that
eventually fails, and the system locks up.

Fix this issue by taking a module reference for every connected
controller (which is what the core layer did to the transport
module). Reference is cleared when the controller is removed.

Acked-by: Himanshu Madhani <hmadhani@marvell.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: James Smart <jsmart2021@gmail.com>
Signed-off-by: Keith Busch <kbusch@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Khalid Elmously <khalid.elmously@canonical.com>
drivers/nvme/host/fc.c
drivers/nvme/target/fcloop.c
drivers/scsi/lpfc/lpfc_nvme.c
drivers/scsi/qla2xxx/qla_nvme.c
include/linux/nvme-fc-driver.h