]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
nvme-fc: don't hold rport lock when putting ctrl
authorDaniel Wagner <wagi@kernel.org>
Thu, 30 Oct 2025 10:05:45 +0000 (11:05 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 8 Jan 2026 09:14:12 +0000 (10:14 +0100)
commit855a444013cf311ff5e49a16255b570fe2b9b7cf
treeab69c29cf23fe3eb1e82d72b4ffe25476d08e257
parent3b4c4f26e87c357677854195c6a060998aa5cc48
nvme-fc: don't hold rport lock when putting ctrl

[ Upstream commit b71cbcf7d170e51148d5467820ae8a72febcb651 ]

nvme_fc_ctrl_put can acquire the rport lock when freeing the
ctrl object:

nvme_fc_ctrl_put
  nvme_fc_ctrl_free
    spin_lock_irqsave(rport->lock)

Thus we can't hold the rport lock when calling nvme_fc_ctrl_put.

Justin suggested use the safe list iterator variant because
nvme_fc_ctrl_put will also modify the rport->list.

Cc: Justin Tee <justin.tee@broadcom.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Daniel Wagner <wagi@kernel.org>
Signed-off-by: Keith Busch <kbusch@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/nvme/host/fc.c