linux-raid.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/2] block, md: Better handle REQ_OP_FLUSH
@ 2023-12-21  1:27 Song Liu
  2023-12-21  1:27 ` [PATCH 1/2] block: Check REQ_OP_FLUSH in op_is_flush() Song Liu
                   ` (2 more replies)
  0 siblings, 3 replies; 9+ messages in thread
From: Song Liu @ 2023-12-21  1:27 UTC (permalink / raw)
  To: linux-block, linux-raid
  Cc: axboe, kent.overstreet, janpieter.sollie, colyli, bagasdotme,
	Song Liu

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

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2023-12-21 19:19 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-12-21  1:27 [PATCH 0/2] block, md: Better handle REQ_OP_FLUSH Song Liu
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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).