From: kbusch@kernel.org (Keith Busch)
Subject: [PATCH] nvme: fix a possible deadlock when passthru commands sent to a multipath device
Date: Wed, 31 Jul 2019 13:11:21 -0600 [thread overview]
Message-ID: <20190731191121.GA15643@localhost.localdomain> (raw)
In-Reply-To: <20190731180026.4725-1-sagi@grimberg.me>
On Wed, Jul 31, 2019@11:00:26AM -0700, Sagi Grimberg wrote:
> When the user issues a command with side effects, we will end up freezing
> the namespace request queue when updating disk info (and the same for
> the corresponding mpath disk node).
>
> However, we are not freezing the mpath node request queue,
> which means that mpath I/O can still come in and block on blk_queue_enter
> (called from nvme_ns_head_make_request -> direct_make_request).
>
> This is a deadlock, because blk_queue_enter will block until the inner
> namespace request queue is unfroze, but that process is blocked because
> the namespace revalidation is trying to update the mpath disk info
> and freeze its request queue (which will never complete because
> of the I/O that is blocked on blk_queue_enter).
>
> Fix this by freezing all the subsystem nsheads request queues before
> executing the passthru command. Given that these commands are infrequent
> we should not worry about this temporary I/O freeze to keep things sane.
Looks good to me.
Reviewed-by: Keith Busch <kbusch at kernel.org>
prev parent reply other threads:[~2019-07-31 19:11 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-07-31 18:00 [PATCH] nvme: fix a possible deadlock when passthru commands sent to a multipath device Sagi Grimberg
2019-07-31 18:35 ` james.puthukattukaran
2019-07-31 19:11 ` Keith Busch [this message]
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=20190731191121.GA15643@localhost.localdomain \
--to=kbusch@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox