nvme: increment request genctr on completion
authorKeith Busch <kbusch@kernel.org>
Mon, 13 Dec 2021 17:08:47 +0000 (09:08 -0800)
committerChristoph Hellwig <hch@lst.de>
Thu, 23 Dec 2021 10:22:45 +0000 (11:22 +0100)
commite4fdb2b167ed225a3793a249c4342da915940b6b
tree3fa752596bcf74d32f4325c28b2e0f2da32b4a99
parentf18ee3d988157ebcadc9b7e5fd34811938f50223
nvme: increment request genctr on completion

The nvme request generation counter is intended to catch duplicate
completions. Incrementing the counter on submission means duplicates can
only be caught if the request tag is reallocated and dispatched prior to
the driver observing the corrupted CQE. Incrementing on completion
removes this window, making it possible to detect duplicate completions
in consecutive entries.

Signed-off-by: Keith Busch <kbusch@kernel.org>
Reviewed-by: Sagi Grimberg <sagi@grimberg.me>
Signed-off-by: Christoph Hellwig <hch@lst.de>
drivers/nvme/host/core.c
drivers/nvme/host/nvme.h