nvme-pci: fix timeout request state check
authorKeith Busch <kbusch@kernel.org>
Wed, 18 Jan 2023 16:44:16 +0000 (08:44 -0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 1 Feb 2023 07:27:13 +0000 (08:27 +0100)
commit5bd69d2ea897c1bb657ee8e5b44b35596c53df16
treeef1262cc862a390604ab6860eef52a4c81bb869b
parent39178dfe8677c22f3a1a58619972cc960e2187f9
nvme-pci: fix timeout request state check

[ Upstream commit 1c5842085851f786eba24a39ecd02650ad892064 ]

Polling the completion can progress the request state to IDLE, either
inline with the completion, or through softirq. Either way, the state
may not be COMPLETED, so don't check for that. We only care if the state
isn't IN_FLIGHT.

This is fixing an issue where the driver aborts an IO that we just
completed. Seeing the "aborting" message instead of "polled" is very
misleading as to where the timeout problem resides.

Fixes: bf392a5dc02a9b ("nvme-pci: Remove tag from process cq")
Signed-off-by: Keith Busch <kbusch@kernel.org>
Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/nvme/host/pci.c