[PATCH V3 0/3] md/raid0: fix a takeover BUG and tidy member-size rounding

From: Zizhi Wo

Date: Mon Nov 02 2026 - 03:47:26 EST


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@xxxxxxxxxxxxxxx/

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

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