linux-nvme.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] nvmet-loop: use nr_phys_segments when map rq to sgl
@ 2018-05-11  6:38 Chaitanya Kulkarni
  2018-05-14  8:32 ` Christoph Hellwig
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Chaitanya Kulkarni @ 2018-05-11  6:38 UTC (permalink / raw)


This patch replaces blk_rq_payload_bytes() with
blk_rq_nr_phys_segments(). For the payloadless requests like
write-zeroes it will trigger BUD_ON() at
sg_alloc_table_chained() since blk_rq_nr_phys_segments()
will evaluate to 0 due to nature of the request.

Signed-off-by: Chaitanya Kulkarni <chaitanya.kulkarni at wdc.com>
---
 drivers/nvme/target/loop.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/nvme/target/loop.c b/drivers/nvme/target/loop.c
index 27a8561c0cb9..4284cefe6d32 100644
--- a/drivers/nvme/target/loop.c
+++ b/drivers/nvme/target/loop.c
@@ -174,7 +174,7 @@ static blk_status_t nvme_loop_queue_rq(struct blk_mq_hw_ctx *hctx,
 			&queue->nvme_sq, &nvme_loop_ops))
 		return BLK_STS_OK;
 
-	if (blk_rq_payload_bytes(req)) {
+	if (blk_rq_nr_phys_segments(req)) {
 		iod->sg_table.sgl = iod->first_sgl;
 		if (sg_alloc_table_chained(&iod->sg_table,
 				blk_rq_nr_phys_segments(req),
-- 
2.14.1

^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2018-05-25  9:10 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-05-11  6:38 [PATCH] nvmet-loop: use nr_phys_segments when map rq to sgl Chaitanya Kulkarni
2018-05-14  8:32 ` Christoph Hellwig
2018-05-14 22:17   ` chaitany kulkarni
2018-05-18  9:09     ` Christoph Hellwig
2018-05-18  9:09 ` Christoph Hellwig
2018-05-25  9:10 ` Christoph Hellwig

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).