All of lore.kernel.org
 help / color / mirror / Atom feed
From: Chaitanya Kulkarni <Chaitanya.Kulkarni@wdc.com>
To: Jens Axboe <axboe@kernel.dk>
Cc: "linux-block@vger.kernel.org" <linux-block@vger.kernel.org>
Subject: Re: [PATCH] null_blk: poll queue support
Date: Sun, 18 Apr 2021 04:49:36 +0000	[thread overview]
Message-ID: <BYAPR04MB49654A1D4AC52FA3A8110240864A9@BYAPR04MB4965.namprd04.prod.outlook.com> (raw)
In-Reply-To: baca710d-0f2a-16e2-60bd-b105b854e0ae@kernel.dk

On 4/17/21 08:30, Jens Axboe wrote:
> +		cmd->error = null_process_cmd(cmd, req_op(req), blk_rq_pos(req),
> +						blk_rq_sectors(req));

How about following on the top of this patch ?

diff --git a/drivers/block/null_blk/main.c b/drivers/block/null_blk/main.c
index 8efaf21cc053..4c27e37ccc51 100644
--- a/drivers/block/null_blk/main.c
+++ b/drivers/block/null_blk/main.c
@@ -1496,6 +1496,7 @@ static int null_map_queues(struct blk_mq_tag_set *set)
 static int null_poll(struct blk_mq_hw_ctx *hctx)
 {
        struct nullb_queue *nq = hctx->driver_data;
+       blk_status_t sts;
        LIST_HEAD(list);
        int nr = 0;
 
@@ -1510,8 +1511,16 @@ static int null_poll(struct blk_mq_hw_ctx *hctx)
                req = list_first_entry(&list, struct request, queuelist);
                list_del_init(&req->queuelist);
                cmd = blk_mq_rq_to_pdu(req);
-               cmd->error = null_process_cmd(cmd, req_op(req),
blk_rq_pos(req),
-                                               blk_rq_sectors(req));
+               if (cmd->nq->dev->zoned)
+                       sts = null_process_zoned_cmd(cmd, req_op(req),
+                                                    blk_rq_pos(req),
+                                                    blk_rq_sectors(req));
+               else
+                       sts = null_process_cmd(cmd, req_op(req),
blk_rq_pos(req),
+                                              blk_rq_sectors(req));
+
+               cmd->error = sts;
+
                nullb_complete_cmd(cmd);
                nr++;
        }

If you are okay I can send a well tested patch with little bit code
cleanup once this is in the tree.



  parent reply	other threads:[~2021-04-18  4:49 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-17 15:29 [PATCH] null_blk: poll queue support Jens Axboe
2021-04-18  4:48 ` Chaitanya Kulkarni
2021-04-18  4:49 ` Chaitanya Kulkarni [this message]
2021-04-19 19:48   ` Jens Axboe
2021-04-19 22:19     ` Chaitanya Kulkarni
2021-04-19 22:55       ` Jens Axboe
2021-05-03 15:47 ` Bart Van Assche
2021-05-03 17:42   ` Jens Axboe
2021-05-04  0:32     ` Bart Van Assche
2021-09-14 21:38 ` Pavel Begunkov
2021-09-16  1:57   ` Jens Axboe
2021-09-20 11:40     ` Pavel Begunkov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=BYAPR04MB49654A1D4AC52FA3A8110240864A9@BYAPR04MB4965.namprd04.prod.outlook.com \
    --to=chaitanya.kulkarni@wdc.com \
    --cc=axboe@kernel.dk \
    --cc=linux-block@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.