kernel_samsung_a53x/drivers/nvme/target
Sagi Grimberg dcac385c9b nvmet: fix ns enable/disable possible hang
[ Upstream commit f97914e35fd98b2b18fb8a092e0a0799f73afdfe ]

When disabling an nvmet namespace, there is a period where the
subsys->lock is released, as the ns disable waits for backend IO to
complete, and the ns percpu ref to be properly killed. The original
intent was to avoid taking the subsystem lock for a prolong period as
other processes may need to acquire it (for example new incoming
connections).

However, it opens up a window where another process may come in and
enable the ns, (re)intiailizing the ns percpu_ref, causing the disable
sequence to hang.

Solve this by taking the global nvmet_config_sem over the entire configfs
enable/disable sequence.

Fixes: a07b4970f464 ("nvmet: add a generic NVMe target")
Signed-off-by: Sagi Grimberg <sagi@grimberg.me>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Chaitanya Kulkarni <kch@nvidia.com>
Signed-off-by: Keith Busch <kbusch@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2024-11-19 12:27:10 +01:00
..
admin-cmd.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
configfs.c nvmet: fix ns enable/disable possible hang 2024-11-19 12:27:10 +01:00
core.c nvmet: remove unnecessary ctrl parameter 2024-11-18 12:10:55 +01:00
discovery.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
fabrics-cmd.c nvmet: nul-terminate the NQNs passed in the connect command 2024-11-18 12:10:55 +01:00
fc.c nvmet-fc: abort command when there is no binding 2024-11-18 22:25:33 +01:00
fcloop.c nvmet-fcloop: swap the list_add_tail arguments 2024-11-18 22:25:33 +01:00
io-cmd-bdev.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
io-cmd-file.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
Kconfig Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
loop.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
Makefile Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
nvmet.h nvmet: remove unnecessary ctrl parameter 2024-11-18 12:10:55 +01:00
passthru.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
rdma.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
tcp.c nvmet-tcp: fix nvme tcp ida memory leak 2024-11-18 22:25:33 +01:00
trace.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
trace.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00