]> 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)
committerKeith Busch <kbusch@kernel.org>
Mon, 1 Dec 2025 21:45:57 +0000 (13:45 -0800)
commitb71cbcf7d170e51148d5467820ae8a72febcb651
tree5ae38cb0a3d0f15ca7b6f175beae5af95aba8801
parent78723fe309f189ee4010d5b7a55f6a14644a40c2
nvme-fc: don't hold rport lock when putting ctrl

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>
drivers/nvme/host/fc.c