All of lore.kernel.org
 help / color / mirror / Atom feed
From: Keith Busch <kbusch@kernel.org>
To: Sagi Grimberg <sagi@grimberg.me>
Cc: Daniel Wagner <dwagner@suse.de>,
	"Belanger, Martin" <Martin.Belanger@dell.com>,
	"linux-nvme@lists.infradead.org" <linux-nvme@lists.infradead.org>
Subject: Re: nvme-tcp: kernel NULL pointer dereference, address: 0000000000000034
Date: Tue, 21 Mar 2023 10:26:13 -0600	[thread overview]
Message-ID: <ZBnape+BlqgWZLFo@kbusch-mbp.dhcp.thefacebook.com> (raw)
In-Reply-To: <038ea0b7-9cf4-4b19-0fd3-bf3cd69342ca@grimberg.me>

On Tue, Mar 21, 2023 at 12:15:47PM +0200, Sagi Grimberg wrote:
> 
> > > > The admin tagset does not have a polled hctxs map to begin with,
> > > > so I'm unclear how any fabrics or admin requests end up polled...
> > > 
> > > Hmm, if no map_queues() callback is provided for the admin tag set,
> > > isn't the
> > > default mapping function used and this would add the poll hctxs map?
> > > Let me add
> > > a map_queues() callback and see what happens :)
> > 
> > admin_tagset.nr_maps = 1 (only the default map, no read, no poll)
> 
> Oddly, I don't see admin/fabrics requests being polled...
> 
> I just attempted with the below patch and it seems to work.
> The only change I did was to pass to blk_poll the cookie as well,
> from bio_poll that is bi_cookie, and from blk_rq_poll it is computed
> from the hctx directly.

I think we can can really simplify this path a lot knowing that we are dealing
with a live request from a polling queue. Then we can poll for requests without
bios too.

---
diff --git a/block/blk-mq.c b/block/blk-mq.c
index d60ef2f0fa50b..b64c7d491306b 100644
--- a/block/blk-mq.c
+++ b/block/blk-mq.c
@@ -1323,8 +1323,6 @@ bool blk_rq_is_poll(struct request *rq)
 		return false;
 	if (rq->mq_hctx->type != HCTX_TYPE_POLL)
 		return false;
-	if (WARN_ON_ONCE(!rq->bio))
-		return false;
 	return true;
 }
 EXPORT_SYMBOL_GPL(blk_rq_is_poll);
@@ -1332,7 +1330,7 @@ EXPORT_SYMBOL_GPL(blk_rq_is_poll);
 static void blk_rq_poll_completion(struct request *rq, struct completion *wait)
 {
 	do {
-		bio_poll(rq->bio, NULL, 0);
+		blk_mq_poll(rq->q, blk_rq_to_qc(rq), NULL, 0);
 		cond_resched();
 	} while (!completion_done(wait));
 }
--


  reply	other threads:[~2023-03-21 16:26 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-15 17:48 nvme-tcp: kernel NULL pointer dereference, address: 0000000000000034 Belanger, Martin
2023-03-15 18:13 ` Keith Busch
2023-03-15 18:23   ` Belanger, Martin
2023-03-15 19:39     ` Keith Busch
2023-03-16  8:57       ` Sagi Grimberg
2023-03-15 22:49     ` Chaitanya Kulkarni
2023-03-15 22:24 ` Keith Busch
2023-03-16  9:00   ` Sagi Grimberg
2023-03-16 15:20     ` Keith Busch
2023-03-16 16:11       ` Sagi Grimberg
2023-03-16 17:19         ` Keith Busch
2023-03-19 13:10           ` Sagi Grimberg
2023-03-21  8:23             ` Daniel Wagner
2023-03-21  8:49               ` Daniel Wagner
2023-03-21  8:56                 ` Sagi Grimberg
2023-03-21  9:09                   ` Daniel Wagner
2023-03-21  9:15                     ` Sagi Grimberg
2023-03-21  9:25                       ` Daniel Wagner
2023-03-21  9:37                         ` Sagi Grimberg
2023-03-21 10:15                           ` Sagi Grimberg
2023-03-21 16:26                             ` Keith Busch [this message]
2023-03-22  7:12                               ` Sagi Grimberg
2023-03-21 10:40                           ` Daniel Wagner
2023-03-21 10:53                             ` Sagi Grimberg
2023-03-21 11:06                               ` Daniel Wagner
2023-03-21 11:10                                 ` Sagi Grimberg
2023-03-21 11:14                                   ` Sagi Grimberg
2023-03-21 12:41                                     ` Daniel Wagner
2023-03-21 12:58                                   ` Daniel Wagner
2023-03-21 13:08                                     ` Sagi Grimberg

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=ZBnape+BlqgWZLFo@kbusch-mbp.dhcp.thefacebook.com \
    --to=kbusch@kernel.org \
    --cc=Martin.Belanger@dell.com \
    --cc=dwagner@suse.de \
    --cc=linux-nvme@lists.infradead.org \
    --cc=sagi@grimberg.me \
    /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.