linux/drivers/nvme/host
Daniel Wagner 0bf567d6d9 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:21:45 +01:00
..
core.c nvme-core: check for too small lba shift 2024-01-25 14:52:27 -08:00
fabrics.c nvme-fabrics: remove superfluous nvmf_host_put in nvmf_parse_options 2021-08-16 14:42:23 +02:00
fabrics.h nvme-fabrics: fix state check in nvmf_ctlr_matches_baseopts() 2022-02-08 18:34:05 +01:00
fault_inject.c nvme: enable to inject errors into admin commands 2019-06-21 11:15:50 +02:00
fc.c nvme-fc: do not wait in vain when unloading module 2024-03-01 13:21:45 +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-pci: add quirk for missing secondary temperature thresholds 2023-06-09 10:32:22 +02:00
ioctl.c nvme: restrict management ioctls to admin 2022-11-26 09:24:48 +01:00
Kconfig nvme: Have NVME_FABRICS select NVME_CORE instead of transport drivers 2021-08-16 21:03:18 +02:00
Makefile remove the lightnvm subsystem 2021-08-14 15:54:09 -06:00
multipath.c nvme-multipath: don't call blk_mark_disk_dead in nvme_mpath_remove_disk 2023-06-09 10:32:26 +02:00
nvme.h nvme: introduce helper function to get ctrl state 2024-01-25 14:52:28 -08:00
pci.c nvme-pci: Add sleep quirk for Kingston drives 2023-12-13 18:36:42 +01:00
rdma.c nvme-rdma: do not try to stop unallocated queues 2023-10-25 11:59:02 +02:00
tcp.c nvme-tcp: fix potential unbalanced freeze & unfreeze 2023-08-16 18:22:03 +02:00
trace.c nvme: add set feature tracing support 2021-08-16 14:42:23 +02:00
trace.h nvme: fix async event trace event 2023-05-11 23:00:28 +09:00
zns.c nvme: split nvme_report_zones 2021-06-03 10:29:26 +03:00