[PATCH] nvme: increment request genctr on completion

Sagi Grimberg sagi at grimberg.me
Tue Dec 14 02:48:38 PST 2021


> 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 at grimberg.me>



More information about the Linux-nvme mailing list