nvme: use queuedata for nvme_req_qid
authorKeith Busch <kbusch@kernel.org>
Thu, 15 Oct 2020 18:36:29 +0000 (11:36 -0700)
committerChristoph Hellwig <hch@lst.de>
Thu, 22 Oct 2020 13:27:14 +0000 (15:27 +0200)
The request's rq_disk isn't set for passthrough IO commands, so tracing
uses qid 0 for these which incorrectly decodes as an admin command. Use
the request_queue's queuedata instead since that value is always set for
the IO queues, and never set for the admin queue.

Signed-off-by: Keith Busch <kbusch@kernel.org>
Signed-off-by: Christoph Hellwig <hch@lst.de>
drivers/nvme/host/nvme.h

index e7c88b40f5bb072bf735d5b40d94efd5601e34ea..cc111136a9818813ba22d7bce5c1d75b6055851a 100644 (file)
@@ -176,7 +176,7 @@ static inline struct nvme_request *nvme_req(struct request *req)
 
 static inline u16 nvme_req_qid(struct request *req)
 {
-       if (!req->rq_disk)
+       if (!req->q->queuedata)
                return 0;
        return blk_mq_unique_tag_to_hwq(blk_mq_unique_tag(req)) + 1;
 }