Linux block layer
 help / color / mirror / Atom feed
From: Song Liu <song@kernel.org>
To: linux-block@vger.kernel.org, linux-raid@vger.kernel.org
Cc: axboe@kernel.dk, kent.overstreet@linux.dev,
	janpieter.sollie@edpnet.be, colyli@suse.de, bagasdotme@gmail.com,
	Song Liu <song@kernel.org>
Subject: [PATCH 0/2] block, md: Better handle REQ_OP_FLUSH
Date: Wed, 20 Dec 2023 17:27:13 -0800	[thread overview]
Message-ID: <20231221012715.3048221-1-song@kernel.org> (raw)

A recent bug report [1] shows md is handling a flush from bcachefs as read:

bch2_journal_write=>
  submit_bio=>
    ...
    md_handle_request =>
      raid5_make_request =>
        chunk_aligned_read =>
          raid5_read_one_chunk =>
	    ...

It appears md code only checks REQ_PREFLUSH for flush requests, which
doesn't cover all cases. OTOH, op_is_flush() doesn't check REQ_OP_FLUSH
either.

Fix this by:
1) Check REQ_PREFLUSH in op_is_flush();
2) Use op_is_flush() in md code.

Thanks,
Song

[1] https://bugzilla.kernel.org/show_bug.cgi?id=218184

Song Liu (2):
  block: Check REQ_OP_FLUSH in op_is_flush()
  md: Use op_is_flush() to check flush bio

 drivers/md/raid0.c        | 2 +-
 drivers/md/raid1.c        | 2 +-
 drivers/md/raid10.c       | 2 +-
 drivers/md/raid5.c        | 2 +-
 include/linux/blk_types.h | 3 ++-
 5 files changed, 6 insertions(+), 5 deletions(-)

--
2.34.1

             reply	other threads:[~2023-12-21  1:27 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-12-21  1:27 Song Liu [this message]
2023-12-21  1:27 ` [PATCH 1/2] block: Check REQ_OP_FLUSH in op_is_flush() Song Liu
2023-12-21  6:12   ` Christoph Hellwig
2023-12-21  7:53     ` Song Liu
2023-12-21  1:27 ` [PATCH 2/2] md: Use op_is_flush() to check flush bio Song Liu
2023-12-21  3:36 ` [PATCH 0/2] block, md: Better handle REQ_OP_FLUSH Ed Tsai (蔡宗軒)
2023-12-21  5:30   ` Kent Overstreet
2023-12-21  7:56     ` Ed Tsai (蔡宗軒)
2023-12-21 19:19       ` Kent Overstreet

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=20231221012715.3048221-1-song@kernel.org \
    --to=song@kernel.org \
    --cc=axboe@kernel.dk \
    --cc=bagasdotme@gmail.com \
    --cc=colyli@suse.de \
    --cc=janpieter.sollie@edpnet.be \
    --cc=kent.overstreet@linux.dev \
    --cc=linux-block@vger.kernel.org \
    --cc=linux-raid@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox