Re: [PATCH] nvme: increment request genctr on completion
From: Sagi Grimberg <sagi@grimberg.me>
Date: 2021-12-14 10:48:56
From: Sagi Grimberg <sagi@grimberg.me>
Date: 2021-12-14 10:48:56
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.
OK, It just occurred to me that blk_mq_tag_to_rq will still return the request after it was completed as tags->rqs[x] is not cleared when ending the request. So this looks good. Reviewed-by: Sagi Grimberg <sagi@grimberg.me>