mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH V3 0/3] md/raid0: fix a takeover BUG and tidy member-size rounding
@ 2026-11-02  8:38 Zizhi Wo
  2026-11-02  8:38 ` [PATCH V3 1/3] md/raid0: reject a takeover whose zones cannot cover the array Zizhi Wo
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Zizhi Wo @ 2026-11-02  8:38 UTC (permalink / raw)
  To: song, yukuai, magiclinan, xiao, linux-raid
  Cc: linux-kernel, yangerkun, chengzhihao1, wozizhi

Patch 1 fixes a syzbot BUG() in find_zone(): a takeover can build strip
zones that cover less than the array still advertises, and I/O for the tail
reaches find_zone(), which cannot map it. Reject such a takeover up front.

Patch 2 factors out the "member size rounded down to a chunk" computation.

Patch 3 uses it in raid0_size() in place of a power-of-2 mask, which is not
a round down for a non-power-of-2 chunk, to consistent with how
create_strip_zones() already rounds the members when building the zones.

Changes since v2:
 - Dropped the first three patches; only the last three are kept. The
   changes needed to restore state on a failed takeover, as well as on the
   subsequent error paths in level_store(), are fairly large and are not
   addressed in this patch set for now.

v2:
https://lore.kernel.org/all/20261019010827.2922617-1-wozizhi@huaweicloud.com/

v1:
https://lore.kernel.org/all/20261017005802.2212102-1-wozizhi@huaweicloud.com/

Zizhi Wo (3):
  md/raid0: reject a takeover whose zones cannot cover the array
  md/raid0: factor out raid0_member_sectors()
  md/raid0: round member size in raid0_size() with sector_div()

 drivers/md/raid0.c | 48 +++++++++++++++++++++++++++++++++++++++++-----
 1 file changed, 43 insertions(+), 5 deletions(-)

-- 
2.52.0


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

end of thread, other threads:[~2026-11-06  8:20 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-11-02  8:38 [PATCH V3 0/3] md/raid0: fix a takeover BUG and tidy member-size rounding Zizhi Wo
2026-11-02  8:38 ` [PATCH V3 1/3] md/raid0: reject a takeover whose zones cannot cover the array Zizhi Wo
2026-11-06  6:34   ` yu kuai
2026-11-06  8:20     ` Zizhi Wo
2026-11-02  8:38 ` [PATCH V3 2/3] md/raid0: factor out raid0_member_sectors() Zizhi Wo
2026-11-02  8:38 ` [PATCH V3 3/3] md/raid0: round member size in raid0_size() with sector_div() Zizhi Wo

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

all inboxes | Powered by JetHome®