[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20221221082131.GA23644@lst.de>
Date: Wed, 21 Dec 2022 09:21:31 +0100
From: Christoph Hellwig <hch@....de>
To: zhangyanjun@...tc.cn
Cc: sagi@...mberg.me, axboe@...nel.dk, kbusch@...nel.org, axboe@...com,
hch@....de, linux-kernel@...r.kernel.org,
linux-nvme@...ts.infradead.org, linux-block@...r.kernel.org
Subject: Re: [PATCH v2] nvme: fix multipath crash caused by flush request
when blktrace is enabled
Just checking for ->bio seems to be:
- simpler
- faster
and does not require block layer internals. So why not just this:
diff --git a/drivers/nvme/host/nvme.h b/drivers/nvme/host/nvme.h
index 6bbb73ef8b2548..424c8a467a0c2a 100644
--- a/drivers/nvme/host/nvme.h
+++ b/drivers/nvme/host/nvme.h
@@ -893,7 +893,7 @@ static inline void nvme_trace_bio_complete(struct request *req)
{
struct nvme_ns *ns = req->q->queuedata;
- if (req->cmd_flags & REQ_NVME_MPATH)
+ if ((req->cmd_flags & REQ_NVME_MPATH) && req->bio)
trace_block_bio_complete(ns->head->disk->queue, req->bio);
}
Powered by blists - more mailing lists