All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/3] md: fix silent data loss in raid10 recovery and llbitmap resize
@ 2026-07-19 14:42 Mykola Marzhan
  2026-07-19 14:42 ` [PATCH 1/3] md/raid10: restore still_degraded detection in recovery Mykola Marzhan
                   ` (2 more replies)
  0 siblings, 3 replies; 8+ messages in thread
From: Mykola Marzhan @ 2026-07-19 14:42 UTC (permalink / raw)
  To: Song Liu, Yu Kuai
  Cc: Li Nan, Xiao Ni, Hannes Reinecke, linux-raid, linux-kernel

While testing llbitmap we found three independent bugs, all in
the silent-data-loss class.

Patch 1 is a one-line v6.12 regression (it reaches the 6.12 LTS
line): the bitmap_operations conversion inverted raid10's
still_degraded detection, so a rebuild on a still-degraded raid10
consumes write-intent bits an absent member still needs, and a
later --re-add serves stale data.

Patch 2: raid10 recovery with llbitmap consults skip_sync_blocks()
with per-device offsets the bitmap cannot interpret, so rebuilds
complete in milliseconds having copied nothing and the array
reports optimal with a stale member.

Patch 3: llbitmap_resize() indexes past the end of its page-control
array (grow crossing a bitmap-page boundary) or silently remaps
chunks (chunksize change); make it fail cleanly instead.  The
pending "md/md-llbitmap: support reshape for RAID10 and RAID5"
series implements real in-place growth and supersedes this guard;
patch 3 exists for mainline today and for stable.

Testing: each bug was reproduced on an unpatched kernel and the fix
verified on a patched one.  Patch 1: classic-bitmap near-2 array,
fail one member of the higher pair, write, fail one member of the
lower pair, rebuild a spare, then --re-add the first failed member
-- it now resyncs the writes it missed instead of returning
instantly with stale data.  Patch 2: near-2 and far-2 spare-add
rebuilds finished in well under a second without the degraded-era
writes (near-2 copied nothing; far-2 only the clean regions) --
fixed, a real recovery runs and the writes are present on the
rebuilt member; a same-member runtime re-add on near-2 was verified
the same way.  Patch 3: the out-of-bounds access was demonstrated
under KASAN; the patched kernel refuses the resize while shrinks
and in-bounds grows keep working.  Each series builds W=1-clean on
its own, applies to current master and to md-7.2, and the two apply
and build together.  The patches are independent of each other.

The patches were developed with AI assistance (see the Assisted-by
trailers); all code was human-reviewed and tested as described above.

Mykola Marzhan (3):
  md/raid10: restore still_degraded detection in recovery
  md: only consult skip_sync_blocks when 'j' is in the bitmap's domain
  md/md-llbitmap: fail resize that needs more bitmap pages

 drivers/md/md-llbitmap.c | 26 ++++++++++++++++++++++++++
 drivers/md/md.c          | 13 ++++++++++++-
 drivers/md/md.h          | 11 +++++++++++
 drivers/md/raid1.c       |  1 +
 drivers/md/raid10.c      |  2 +-
 drivers/md/raid5.c       |  3 +++
 6 files changed, 54 insertions(+), 2 deletions(-)


base-commit: 0e35b9b6ec0ffcc5e23cbdec09f5c622ad532b53
-- 
2.43.0


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

end of thread, other threads:[~2026-07-20  4:32 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-07-19 14:42 [PATCH 0/3] md: fix silent data loss in raid10 recovery and llbitmap resize Mykola Marzhan
2026-07-19 14:42 ` [PATCH 1/3] md/raid10: restore still_degraded detection in recovery Mykola Marzhan
2026-07-20  2:17   ` yu kuai
2026-07-20  4:32   ` Paul Menzel
2026-07-19 14:42 ` [PATCH 2/3] md: only consult skip_sync_blocks when 'j' is in the bitmap's domain Mykola Marzhan
2026-07-20  2:25   ` yu kuai
2026-07-19 14:42 ` [PATCH 3/3] md/md-llbitmap: fail resize that needs more bitmap pages Mykola Marzhan
2026-07-19 15:05   ` sashiko-bot

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.