]> 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>
Mon, 19 Jan 2026 12:09:48 +0000 (13:09 +0100)
commit4099d8f057f265902bc087399492cb52ee4f5bdd
tree45f3df32c799e21159a7034de416a5e1e09a9394
parent8cb8a84f7af3568e29e8e5f39c0e4d1778b65981
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