nvme-pci: Fix abort command id
authorKeith Busch <kbusch@kernel.org>
Thu, 7 Oct 2021 06:50:31 +0000 (23:50 -0700)
committerKeith Busch <kbusch@kernel.org>
Thu, 7 Oct 2021 15:02:06 +0000 (08:02 -0700)
The request tag is no longer the only component of the command id.

Fixes: e7006de6c2380 ("nvme: code command_id with a genctr for use-after-free validation")
Reviewed-by: Sagi Grimberg <sagi@grimberg.me>
Signed-off-by: Keith Busch <kbusch@kernel.org>
drivers/nvme/host/pci.c

index b82492c..7fc992a 100644 (file)
@@ -1330,7 +1330,7 @@ static enum blk_eh_timer_return nvme_timeout(struct request *req, bool reserved)
        iod->aborted = 1;
 
        cmd.abort.opcode = nvme_admin_abort_cmd;
-       cmd.abort.cid = req->tag;
+       cmd.abort.cid = nvme_cid(req);
        cmd.abort.sqid = cpu_to_le16(nvmeq->qid);
 
        dev_warn(nvmeq->dev->ctrl.device,