linux/drivers/nvme/host
Daniel Wagner baa6b7eb8c nvme-fc: do not wait in vain when unloading module
[ Upstream commit 70fbfc47a3 ]

The module exit path has race between deleting all controllers and
freeing 'left over IDs'. To prevent double free a synchronization
between nvme_delete_ctrl and ida_destroy has been added by the initial
commit.

There is some logic around trying to prevent from hanging forever in
wait_for_completion, though it does not handling all cases. E.g.
blktests is able to reproduce the situation where the module unload
hangs forever.

If we completely rely on the cleanup code executed from the
nvme_delete_ctrl path, all IDs will be freed eventually. This makes
calling ida_destroy unnecessary. We only have to ensure that all
nvme_delete_ctrl code has been executed before we leave
nvme_fc_exit_module. This is done by flushing the nvme_delete_wq
workqueue.

While at it, remove the unused nvme_fc_wq workqueue too.

Reviewed-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: Daniel Wagner <dwagner@suse.de>
Signed-off-by: Keith Busch <kbusch@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
History 2024-03-01 13:34:52 +01:00
..
apple.c nvme-apple: return directly instead of else 2023-04-13 08:55:06 +02:00
auth.c nvme-auth: set explanation code for failure2 msgs 2023-12-20 17:01:57 +01:00
constants.c nvme fixes for Linux 6.5 2023-06-30 14:04:08 -06:00
core.c nvme: fix deadlock between reset and scan 2024-01-20 11:51:41 +01:00
fabrics.c nvme: blank out authentication fabrics options if not configured 2023-12-03 07:33:06 +01:00
fabrics.h nvme-fabrics: check hostid using uuid_equal 2023-06-12 10:36:58 -07:00
fault_inject.c nvme: fix parameter check in nvme_fault_inject_init() 2023-07-12 08:48:33 -07:00
fc.c nvme-fc: do not wait in vain when unloading module 2024-03-01 13:34:52 +01:00
fc.h nvme-fc: Update header and host for common definitions for LS handling 2020-05-09 16:18:33 -06:00
hwmon.c nvme: host: hwmon: constify pointers to hwmon_channel_info 2023-08-21 12:54:02 -07:00
ioctl.c nvme-ioctl: move capable() admin check to the end 2024-01-20 11:51:41 +01:00
Kconfig nvme-auth: Diffie-Hellman key exchange support 2022-08-02 17:14:49 -06:00
Makefile SCSI misc on 20230629 2023-06-30 11:57:07 -07:00
multipath.c nvme fixes for Linux 6.5 2023-06-30 14:04:08 -06:00
nvme.h nvme: fix deadlock between reset and scan 2024-01-20 11:51:41 +01:00
pci.c nvme: ensure reset state check ordering 2024-01-20 11:51:41 +01:00
pr.c nvme: Add pr_ops read_reservation support 2023-04-11 21:55:36 -04:00
rdma.c nvme: ensure reset state check ordering 2024-01-20 11:51:41 +01:00
sysfs.c nvme: warn only once for legacy uuid attribute 2023-07-12 08:48:19 -07:00
tcp.c nvme: ensure reset state check ordering 2024-01-20 11:51:41 +01:00
trace.c nvme: implement In-Band authentication 2022-08-02 17:14:49 -06:00
trace.h nvme: fix async event trace event 2023-04-13 08:59:04 +02:00
zns.c scsi: nvme: zns: Set zone limits before revalidating zones 2023-07-05 21:58:10 -04:00