Linux RAID subsystem development
 help / color / mirror / Atom feed
* [PATCH 0/3] md: raid helper cleanups
@ 2026-08-27  7:56 Li Youhong
  2026-08-27  7:56 ` [PATCH 1/3] md: add rdev_record_write_error() helper Li Youhong
                   ` (3 more replies)
  0 siblings, 4 replies; 6+ messages in thread
From: Li Youhong @ 2026-08-27  7:56 UTC (permalink / raw)
  To: song, yukuai; +Cc: magiclinan, xiao, linux-raid, Li Youhong

From: Li Youhong <liyouhong@kylinos.cn>

This series factors a few repeated md/raid patterns into small helpers.
There is no intentional behaviour change; each patch is a mechanical
extract of existing logic.

Patch 1 adds rdev_record_write_error() in md.h for the
WriteErrorSeen + WantReplacement + MD_RECOVERY_NEEDED sequence shared by
raid1, raid10 and raid5.

Patches 2 and 3 move raid1/raid10-only helpers into raid1-10.c, which is
#included by both drivers:

  - rdev_bb_block_sectors() for the badblocks-aligned block size used in
    narrow_write_error()
  - flush_bio_list() for the bitmap plug flush path previously duplicated
    in raid10's flush_pending_writes() and raid10_unplug()

The helpers in raid1-10.c follow the existing static inline convention
used by raid1_submit_write(), check_decay_read_errors(), and others in
that file.

Li Youhong (3):
      md: add rdev_record_write_error() helper
      md/raid1-10: add rdev_bb_block_sectors() helper
      md/raid1-10: share flush_bio_list between raid1 and raid10
---
 drivers/md/md.h       |  7 +++++++
 drivers/md/raid1-10.c | 27 +++++++++++++++++++++++++++
 drivers/md/raid1.c    | 42 +++++++-----------------------------------
 drivers/md/raid10.c   | 50 +++++++-------------------------------------------
 drivers/md/raid5.c    |  5 +----
 5 files changed, 48 insertions(+), 83 deletions(-)


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

end of thread, other threads:[~2026-09-05  2:44 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-08-27  7:56 [PATCH 0/3] md: raid helper cleanups Li Youhong
2026-08-27  7:56 ` [PATCH 1/3] md: add rdev_record_write_error() helper Li Youhong
2026-08-27  7:56 ` [PATCH 2/3] md/raid1-10: add rdev_bb_block_sectors() helper Li Youhong
2026-08-27  8:15   ` sashiko-bot
2026-08-27  7:56 ` [PATCH 3/3] md/raid1-10: share flush_bio_list between raid1 and raid10 Li Youhong
2026-09-05  2:43 ` [PATCH 0/3] md: raid helper cleanups yu kuai

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox