All of lore.kernel.org
 help / color / mirror / Atom feed
From: Bart Van Assche <bvanassche@acm.org>
To: Jens Axboe <axboe@kernel.dk>
Cc: linux-block@vger.kernel.org, Christoph Hellwig <hch@lst.de>,
	Bart Van Assche <bvanassche@acm.org>
Subject: [PATCH 0/2] Fix a race condition triggered by submit_bio()
Date: Tue, 30 Jul 2019 11:17:55 -0700	[thread overview]
Message-ID: <20190730181757.248832-1-bvanassche@acm.org> (raw)

Hi Jens,

One of the consequences of the switch to blk-mq is that generic_make_request()
calls, a function called by submit_bio(), must be protected by a
blk_queue_enter() / blk_queue_exit() pair to avoid that the block-cgroup
functions called by generic_make_request() trigger a race condition. This patch
series makes the kernel report a warning if that race condition is hit and also
adds the necessary protection in submit_bio(). Please consider these patches
for kernel v5.4.

Thanks,

Bart.

Bart Van Assche (2):
  block: Verify whether blk_queue_enter() is used when necessary
  block: Fix a race condition in submit_bio()

 block/blk-cgroup.c         |  2 ++
 block/blk-core.c           | 34 +++++++++++++++++++++++++++++++++-
 include/linux/blk-cgroup.h |  2 ++
 include/linux/blkdev.h     |  8 ++++++++
 4 files changed, 45 insertions(+), 1 deletion(-)

-- 
2.22.0.709.g102302147b-goog


             reply	other threads:[~2019-07-30 18:18 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-07-30 18:17 Bart Van Assche [this message]
2019-07-30 18:17 ` [PATCH 1/2] block: Verify whether blk_queue_enter() is used when necessary Bart Van Assche
2019-07-31  1:46   ` Ming Lei
2019-07-31 18:26     ` Bart Van Assche
2019-07-30 18:17 ` [PATCH 2/2] block: Fix a race condition in submit_bio() Bart Van Assche
2019-07-30 18:18   ` syzbot
2019-07-31  1:53   ` Ming Lei
2019-07-31  1:53     ` syzbot

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=20190730181757.248832-1-bvanassche@acm.org \
    --to=bvanassche@acm.org \
    --cc=axboe@kernel.dk \
    --cc=hch@lst.de \
    --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.