]> www.infradead.org Git - nvme.git/commit
nvme: reset delayed remove_work after reconnect
authorChristoph Hellwig <hch@lst.de>
Wed, 11 Jun 2025 04:50:47 +0000 (06:50 +0200)
committerChristoph Hellwig <hch@lst.de>
Tue, 17 Jun 2025 10:57:26 +0000 (12:57 +0200)
commit05598c261a9689e334a4af977ee1409e257e5dd4
tree3aa0aec95978e45f5ba033b8a5903dd8f4f610f4
parent9ce6c9875f3e995be5fd720b65835291f8a609b1
nvme: reset delayed remove_work after reconnect

The remove_work will proceed with permanently disconnecting on the
initial final path failure if the head shows no paths after the delay.
If a new path connects while the remove_work is pending, and if that new
path happens to disconnect before that remove_work executes, the delayed
removal should reset based on the most recent path disconnect time, but
queue_delayed_work() won't do anything if the work is already pending.
Attempt to cancel the delayed work when a new path connects, and use
mod_delayed_work() in case the remove_work remains pending anyway.

Signed-off-by: Keith Busch <kbusch@kernel.org>
Reviewed-by: Nilay Shroff <nilay@linux.ibm.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
drivers/nvme/host/core.c
drivers/nvme/host/multipath.c