* [REGRESSION] md/raid10: far-layout member left with stale data after bitmap re-add (6.11+, 6.12.y, 6.18.y)
@ 2026-11-30 19:31 Eric Hagberg
2026-11-30 19:48 ` sashiko-bot
2026-12-04 17:46 ` [PATCH RESEND 0/3] md/raid10: fix old data left by skipped and interrupted sync Eric Hagberg
0 siblings, 2 replies; 10+ messages in thread
From: Eric Hagberg @ 2026-11-30 19:31 UTC (permalink / raw)
To: linux-raid, Song Liu, Yu Kuai; +Cc: Li Nan, Xiao Ni, stable, regressions
Hi,
On 6.12.y and 6.18.y, re-adding a member to a RAID10 array with the far
layout and an internal bitmap can complete "successfully" ([UU]) while
the re-added member still holds stale data for regions written while it
was absent. 6.1.y is not affected. This was seen on 2-disk
far=2 arrays (NVMe, internal bitmap, 64 MiB bitmap chunk) after a member
dropped out and came back; filesystems on the arrays were corrupted and
"check" reported non-zero mismatch_cnt.
#regzbot introduced: bc49694a9e8f
Reproducer (loop devices, 2 x 16 GiB zero-filled sparse files):
mdadm --create /dev/md/r10 --run --assume-clean --metadata=1.2 \
--level=10 --raid-devices=2 --layout=f2 --chunk=512 \
--bitmap=internal --bitmap-chunk=65536 /dev/loopA /dev/loopB
mdadm /dev/md/r10 --fail /dev/loopB --remove /dev/loopB
# write a 64 MiB random payload with O_DIRECT to every third
# 64 MiB bitmap chunk (85 regions)
mdadm /dev/md/r10 --re-add /dev/loopB # bitmap-based recovery
mdadm --wait /dev/md/r10 # until [UU]
echo check > /sys/block/mdX/md/sync_action; mdadm --wait /dev/md/r10
cat /sys/block/mdX/md/mismatch_cnt
mdadm /dev/md/r10 --fail /dev/loopA --remove /dev/loopA
# read the 85 regions back (now served only by loopB) and compare
Results ("OK" = mismatch_cnt 0 and every region read back correctly from
the re-added member):
kernel far=2 near=2
6.1 OK OK
6.12 CORRUPTION OK
6.18 CORRUPTION OK
We have not yet tested 7.x. A full script is available on request.
Our analysis, which we would appreciate having checked:
Commit bc49694a9e8f ("md: pass in max_sectors for pers->sync_request()"),
merged in v6.11, removed the recomputation of max_sector at the
'skipped:' label in raid10_sync_request(). The giveup path still shrinks
max_sector to sector_nr + max_sync, advances sector_nr to it and jumps
back to the label, where "sector_nr >= max_sector" is now true. The
function then takes the end-of-sync branch and calls the bitmap's
close_sync(), which clears RESYNC on every bitmap chunk whose sync has
started, as if it had completed.
During a bitmap-based recovery, every region that is clean in the bitmap
takes the giveup path. With the far layout, the data covered by one
bitmap chunk is split between the first and second halves of the
recovering member. Once a clean region is skipped, chunks whose first
half has been recovered are treated as done, their second half is
skipped, and the member is marked In_sync with stale data. Near layouts
recover each bitmap chunk contiguously, which matches what we see.
In mainline, 7435b73f05fb ("md/raid10: cleanup skip handling in
raid10_sync_request"), in v7.0, removed the skip loop and carries
"Fixes: bc49694a9e8f", but has no Cc: stable and is not in 6.12.y or
6.18.y. It is patch 11 of a 12-patch series and appears to depend on
earlier patches in it (it stops checking rdev_set_badblocks() return
values, which relies on "md: mark rdev Faulty when badblocks setting
fails").
Questions:
1. Does this analysis look right to you?
2. What is the preferred fix for 6.12.y and 6.18.y: backporting
7435b73f05fb together with the patches it depends on, or a smaller
targeted fix?
As a starting point for discussion only (not a formal submission), the
minimal change we tried restores the pre-6.11 recomputation by resetting
max_sector to the caller's value at the label. With it, the reproducer
passes for both layouts on 6.12 and 6.18. We have since had
concerns raised about it internally and would value your view on
whether it is safe:
--- a/drivers/md/raid10.c
+++ b/drivers/md/raid10.c
@@ -3191,6 +3191,7 @@ static sector_t raid10_sync_request(stru
sector_t chunk_mask = conf->geo.chunk_mask;
int page_idx = 0;
int error_disk = -1;
+ sector_t orig_max_sector = max_sector;
/*
* Allow skipping a full rebuild for incremental assembly
@@ -3212,6 +3213,7 @@ static sector_t raid10_sync_request(stru
return 0;
skipped:
+ max_sector = orig_max_sector;
if (sector_nr >= max_sector) {
conf->cluster_sync_low = 0;
conf->cluster_sync_high = 0;
Thanks,
Eric Hagberg
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [REGRESSION] md/raid10: far-layout member left with stale data after bitmap re-add (6.11+, 6.12.y, 6.18.y)
2026-11-30 19:31 [REGRESSION] md/raid10: far-layout member left with stale data after bitmap re-add (6.11+, 6.12.y, 6.18.y) Eric Hagberg
@ 2026-11-30 19:48 ` sashiko-bot
2026-12-04 17:46 ` [PATCH RESEND 0/3] md/raid10: fix old data left by skipped and interrupted sync Eric Hagberg
1 sibling, 0 replies; 10+ messages in thread
From: sashiko-bot @ 2026-11-30 19:48 UTC (permalink / raw)
To: Eric Hagberg, linux-raid; +Cc: yukuai
Thank you for your contribution! Sashiko AI review found 5 potential
issues to consider:
- [High] md/raid10: missing Signed-off-by trailer and informal inquiry
commit message
- [High] md/raid10: premature end-of-sync teardown and false abort in
raid10_sync_request()
- [High] md/raid10: infinite loop or 0-length bio in
raid10_sync_request() at resync_max
- [Medium] md/raid10: broken sectors_skipped accounting and tight skip
loop in raid10_sync_request()
- [Low] md/raid10: missing Fixes trailer for commit bc49694a9e8f in
commit message
--
commit d99e7ee24942d79bda6cdab910442b35145994a1
Author: Eric Hagberg <ehagberg@janestreet.com>
> md/raid10: far-layout member left with stale data after bitmap re-add (6.11+, 6.12.y, 6.18.y)
>
> Hi,
>
> On 6.12.y and 6.18.y, re-adding a member to a RAID10 array with the far
> layout and an internal bitmap can complete "successfully" ([UU]) while
> the re-added member still holds stale data for regions written while it
> was absent. 6.1.y is not affected. This was seen on 2-disk
> far=2 arrays (NVMe, internal bitmap, 64 MiB bitmap chunk) after a member
> dropped out and came back; filesystems on the arrays were corrupted and
> "check" reported non-zero mismatch_cnt.
>
> #regzbot introduced: bc49694a9e8f
>
> Reproducer (loop devices, 2 x 16 GiB zero-filled sparse files):
>
> mdadm --create /dev/md/r10 --run --assume-clean --metadata=1.2 \
> --level=10 --raid-devices=2 --layout=f2 --chunk=512 \
> --bitmap=internal --bitmap-chunk=65536 /dev/loopA /dev/loopB
> mdadm /dev/md/r10 --fail /dev/loopB --remove /dev/loopB
> # write a 64 MiB random payload with O_DIRECT to every third
> # 64 MiB bitmap chunk (85 regions)
> mdadm /dev/md/r10 --re-add /dev/loopB # bitmap-based recovery
> mdadm --wait /dev/md/r10 # until [UU]
> echo check > /sys/block/mdX/md/sync_action; mdadm --wait /dev/md/r10
> cat /sys/block/mdX/md/mismatch_cnt
> mdadm /dev/md/r10 --fail /dev/loopA --remove /dev/loopA
> # read the 85 regions back (now served only by loopB) and compare
>
> Results ("OK" = mismatch_cnt 0 and every region read back correctly from
> the re-added member):
>
> kernel far=2 near=2
> 6.1 OK OK
> 6.12 CORRUPTION OK
> 6.18 CORRUPTION OK
>
> We have not yet tested 7.x. A full script is available on request.
>
> Our analysis, which we would appreciate having checked:
>
> Commit bc49694a9e8f ("md: pass in max_sectors for pers->sync_request()"),
> merged in v6.11, removed the recomputation of max_sector at the
> 'skipped:' label in raid10_sync_request(). The giveup path still shrinks
> max_sector to sector_nr + max_sync, advances sector_nr to it and jumps
> back to the label, where "sector_nr >= max_sector" is now true. The
> function then takes the end-of-sync branch and calls the bitmap's
> close_sync(), which clears RESYNC on every bitmap chunk whose sync has
> started, as if it had completed.
>
> During a bitmap-based recovery, every region that is clean in the bitmap
> takes the giveup path. With the far layout, the data covered by one
> bitmap chunk is split between the first and second halves of the
> recovering member. Once a clean region is skipped, chunks whose first
> half has been recovered are treated as done, their second half is
> skipped, and the member is marked In_sync with stale data. Near layouts
> recover each bitmap chunk contiguously, which matches what we see.
>
> In mainline, 7435b73f05fb ("md/raid10: cleanup skip handling in
> raid10_sync_request"), in v7.0, removed the skip loop and carries
> "Fixes: bc49694a9e8f", but has no Cc: stable and is not in 6.12.y or
> 6.18.y. It is patch 11 of a 12-patch series and appears to depend on
> earlier patches in it (it stops checking rdev_set_badblocks() return
> values, which relies on "md: mark rdev Faulty when badblocks setting
> fails").
>
> Questions:
>
> 1. Does this analysis look right to you?
> 2. What is the preferred fix for 6.12.y and 6.18.y: backporting
> 7435b73f05fb together with the patches it depends on, or a smaller
> targeted fix?
>
> As a starting point for discussion only (not a formal submission), the
> minimal change we tried restores the pre-6.11 recomputation by resetting
> max_sector to the caller's value at the label. With it, the reproducer
> passes for both layouts on 6.12 and 6.18. We have since had
> concerns raised about it internally and would value your view on
> whether it is safe:
[Severity: High]
This commit is missing a Signed-off-by: trailer and has an informal
mailing-list inquiry as its changelog rather than a commit description.
[Severity: Low]
For a formal submission fixing the regression, the commit message should
also carry:
Fixes: bc49694a9e8f ("md: pass in max_sectors for pers->sync_request()")
> diff --git a/drivers/md/raid10.c b/drivers/md/raid10.c
> index 2a9c4ee982e02..bddab5f9909e2 100644
> --- a/drivers/md/raid10.c
> +++ b/drivers/md/raid10.c
> @@ -3150,6 +3150,7 @@ static sector_t raid10_sync_request(struct mddev *mddev, sector_t sector_nr,
> sector_t chunk_mask = conf->geo.chunk_mask;
> int page_idx = 0;
> int error_disk = -1;
> + sector_t orig_max_sector = max_sector;
>
> /*
> * Allow skipping a full rebuild for incremental assembly
> @@ -3171,6 +3172,7 @@ static sector_t raid10_sync_request(struct mddev *mddev, sector_t sector_nr,
> return 0;
>
> skipped:
> + max_sector = orig_max_sector;
> if (sector_nr >= max_sector) {
> conf->cluster_sync_low = 0;
> conf->cluster_sync_high = 0;
[Severity: High]
Can resetting max_sector at skipped: trigger premature end-of-sync
teardown and a false abort when a skipped region reaches the end of the
array?
md_do_sync() only updates mddev->curr_resync after ->sync_request()
returns, and only calls ->sync_request(mddev, max_sectors, max_sectors,
&skipped) to run the sector_nr >= max_sector teardown block after waiting
for mddev->recovery_active to drain. When a mid-sync call skips clean
bitmap blocks up to orig_max_sector via giveup:, sector_nr reaches
max_sector inside the active iteration while mddev->curr_resync is still
the starting offset j (< max_sector):
drivers/md/raid10.c:raid10_sync_request() {
...
if (sector_nr >= max_sector) {
...
if (mddev->curr_resync < max_sector) { /* aborted */
if (test_bit(MD_RECOVERY_SYNC, &mddev->recovery))
md_bitmap_end_sync(mddev->bitmap, mddev->curr_resync,
&sync_blocks, 1);
else for (i = 0; i < conf->geo.raid_disks; i++) {
sector_t sect =
raid10_find_virt(conf, mddev->curr_resync, i);
md_bitmap_end_sync(mddev->bitmap, sect,
&sync_blocks, 1);
}
} else {
...
}
md_bitmap_close_sync(mddev->bitmap);
close_sync(conf);
*skipped = 1;
return sectors_skipped;
}
}
Because mddev->curr_resync < max_sector is always true here, this takes
the aborted branch (calling md_bitmap_end_sync(..., 1), which can re-mark
already-synced bitmap chunks with NEEDED_MASK, and skipping replacement
recovery_offset = MaxSector and conf->fullsync = 0). It also runs
md_bitmap_close_sync() while earlier recovery I/Os are still in flight,
and destroys conf->r10buf_pool in close_sync(conf) before md_do_sync()
makes its final end-of-sync call (which then re-initializes and
re-destroys r10buf_pool).
[Severity: High]
What happens when mddev->resync_max is set below orig_max_sector (for
example via /sys/block/mdX/md/sync_max) and the giveup -> skipped loop
advances sector_nr up to mddev->resync_max?
At skipped:, resetting max_sector = orig_max_sector makes sector_nr >=
max_sector false because sector_nr == mddev->resync_max < orig_max_sector.
Later in raid10_sync_request(), max_sector is clamped back down to
mddev->resync_max:
drivers/md/raid10.c:raid10_sync_request() {
...
if (max_sector > mddev->resync_max)
max_sector = mddev->resync_max; /* Don't do IO beyond here */
...
}
Execution then continues with sector_nr == max_sector. If the block at
resync_max is clean in the bitmap, chunks_skipped is set to -1 and giveup:
adds 0 to sector_nr, increments chunks_skipped back to 0, and jumps to
skipped: in an unbreakable infinite loop. If the block at resync_max
needs syncing, the page-adding loop sees len == 0 on page_idx == 0 and
submits a 0-sector bio with no pages.
[Severity: Medium]
Does re-enabling the internal giveup -> skipped loop across clean bitmap
regions also break sectors_skipped accounting when a dirty chunk follows
a skipped clean region?
When raid10_sync_request() skips clean bitmap blocks and then submits I/O
for a dirty block in the same call, it finishes with:
drivers/md/raid10.c:raid10_sync_request() {
...
if (sectors_skipped)
/* pretend they weren't skipped, it makes
* no important difference in this case
*/
md_done_sync(mddev, sectors_skipped, 1);
return sectors_skipped + nr_sectors;
}
This has several bad interactions with md_do_sync():
1. md_done_sync() takes a signed int blocks argument (truncating 64-bit
sector_t sectors_skipped above 1 TiB) and subtracts it from
mddev->recovery_active before raid10_sync_request() returns and before
md_do_sync() adds the returned sectors to mddev->recovery_active,
transiently underflowing recovery_active.
2. Because *skipped is 0, md_do_sync() adds sectors_skipped + nr_sectors
to io_sectors, counting skipped clean bitmap space as completed disk
I/O and inflating currspeed above speed_max(mddev), which stalls
recovery in msleep(500) for up to 30 seconds.
3. Because clean bitmap blocks set chunks_skipped = -1 and cap max_sync at
128 KiB, the internal loop scans clean regions in 128 KiB steps without
cond_resched() or MD_RECOVERY_INTR checks when conf->nr_waiting == 0,
and sleeps 1 jiffy per 128 KiB in schedule_timeout_uninterruptible(1)
whenever conf->nr_waiting > 0.
--
Sashiko AI review · https://sashiko.dev/#/patchset/20261130193139.1401044-1-ehagberg@janestreet.com?part=1
^ permalink raw reply [flat|nested] 10+ messages in thread
* [PATCH RESEND 0/3] md/raid10: fix old data left by skipped and interrupted sync
2026-11-30 19:31 [REGRESSION] md/raid10: far-layout member left with stale data after bitmap re-add (6.11+, 6.12.y, 6.18.y) Eric Hagberg
2026-11-30 19:48 ` sashiko-bot
@ 2026-12-04 17:46 ` Eric Hagberg
2026-12-04 17:46 ` [PATCH RESEND 1/3] md/raid10: do not skip past the range that sync_request examined Eric Hagberg
` (2 more replies)
1 sibling, 3 replies; 10+ messages in thread
From: Eric Hagberg @ 2026-12-04 17:46 UTC (permalink / raw)
To: Song Liu, Yu Kuai
Cc: Eric Hagberg, Li Nan, Xiao Ni, Jason Chu, linux-raid,
linux-kernel, regressions
Hi,
Resending: my first send of this series reached only Song and Yu, not
the lists and other people on Cc. Nothing else has changed.
This follows up my report earlier in this thread. The three patches are
by Jason Chu; I am sending them on his behalf.
They fix cases in which raid10 with the classic write-intent bitmap
finishes a recovery or a resync while one copy still holds old data. md
reports the array as healthy afterwards. Each case is reproduced on
v7.4-rc5 with the shell script at the end of this mail (mdadm, loop
devices and sysfs; one test also uses dm-linear).
Patch 1: a bitmap based recovery that is not interrupted leaves old data
on the re-added member when the chunk size is below 64KiB. This is a
regression from 7435b73f05fb ("md/raid10: cleanup skip handling in
raid10_sync_request"), which dropped the limit of a skip to the range
that was examined.
Patch 2: a bitmap based recovery that is interrupted ("frozen" written
to sync_action, or the array stopped and reassembled) and then resumed
leaves old data on the re-added member. Reproduced with the far layout
and one returning member, and with the offset layout and two returning
members.
Patch 3: a resync that is interrupted just after it passed a bad block
near the end of a bitmap chunk forgets that the next bitmap chunk is
dirty. The restarted resync does not make the copies in that chunk
equal.
Results:
x86-64 KVM guest with two CPUs, 4KiB pages, mdadm 4.2, loop devices on
tmpfs. Each column is v7.4-rc5 with the patches up to that one applied.
The raid10 module was built from the patched raid10.c; the rest of the
kernel is the same in all columns. A kernel built without CONFIG_SMP
gave the same table.
v7.4-rc5 +1 +1,2 +1,2,3
far-recovery PASS PASS PASS PASS
recovery-small-chunk FAIL PASS PASS PASS
recovery-abort-far FAIL FAIL PASS PASS
recovery-abort-offset FAIL FAIL PASS PASS
resync-abort FAIL FAIL FAIL PASS
FAIL means that md reported the array idle and not degraded, a "check"
then counted mismatches, and the copies read from the member devices
were not the data that was written. The script prints the details. For
the last three tests Jason also ran each test with virtio disks and read
the same sectors from the disk images on the host after the guest had
exited. The host agreed with the guest on every copy.
The same script on bare metal (x86-64, a distribution userspace with
udev, mdadm 4.2), on 7.3.7 without and with the series:
7.3.7 +1,2,3
far-recovery PASS PASS
recovery-small-chunk FAIL PASS
recovery-abort-far FAIL PASS
recovery-abort-offset FAIL PASS
resync-abort FAIL PASS
For the recovery tests the failure counts on 7.3.7 are the same as on
v7.4-rc5.
On bare metal, with a separate script that interrupts recovery either
with "frozen" or with mdadm --stop and reassembly, the abort case that
patch 2 fixes also shows on 7.3.0 and on 6.1.193: in each case a
continued recovery is clean, and an interrupted and resumed one leaves
old copies on the returning member. Stopping and reassembling gives the
same result as "frozen", so an orderly reboot during recovery is enough.
"far-recovery" is the case that 7435b73f05fb fixed. It passes on
v7.4-rc5 and is in the script because it fails on the stable kernels
that have bc49694a9e8f ("md: pass in max_sectors for
pers->sync_request()") but not 7435b73f05fb. We see it on 6.12.117 and
6.18.65.
How this was found:
We run 6.12.y. A far layout array there returned old data after a
member was re-added. That is the "far-recovery" case, which I reported
earlier in this thread. While Jason prepared a backport of 7435b73f05fb
he tested the skip and abort paths of raid10_sync_request() and found
the three cases above. A backport that contains 7435b73f05fb and these
three patches is in testing on 6.12.117 and 6.18.65; we will send it to
stable@ once these patches are in mainline.
What was tested, and what was not:
- Live, v7.4-rc5: the table above. Nothing else was run on mainline.
The test kernels are minimal builds without KASAN, KCSAN or lockdep.
- Live, 6.12.117 with the backport: the same script, and a larger set
of QEMU runs with fault injection, power loss and KASAN, KCSAN and
lockdep kernels.
- The mainline patches are not the same text as the 6.12.y code. They
test for the classic bitmap with mddev->bitmap_id, patch 1 adds the
limit where 6.12.y still had it, and the abort branch is laid out
differently.
- Built for i386 and arm64 (raid10 built in) on 7.3.7 with the series,
and on 6.18.65 with the 6.18.y backport; arm64 also on 6.12.117 with
the 6.12.y backport. vmlinux links and there are no new warnings.
- Not tested: llbitmap, clustered md, dm-raid, reshape, and 64KiB
pages on mainline.
Known limits:
- After an interrupted recovery, a bitmap chunk whose copies were all
finished stays dirty and is copied again. After an interrupted
resync the bitmap is walked twice.
- The clean-bitmap return in the resync path can still move the cursor
past sync_max. No I/O is done past sync_max. Not changed here.
- From reading the code, not reproduced on mainline:
md_bitmap_get_counter() reports the span of a whole counter page for
a hijacked page, although each of its two counters covers half. The
walk added in patch 2 allows for that. The skip decisions in
raid10_sync_request() do not. Not changed here.
- raid1 and raid5 end an aborted sync in the same way (end_sync at
curr_resync, then close_sync). We did not examine or test them.
Questions:
1. Would you prefer the abort handling in md-bitmap.c, for example a
close_sync that takes the abort position and re-arms the chunks
from there on, as llbitmap_end_sync() already does? That could
serve raid1 and raid5 too. The patches keep it in raid10.c because
that is what we have tested.
2. For 6.12.y and 6.18.y: 7435b73f05fb alone makes the two
recovery-abort tests fail there, although they pass on 6.12.117 and
6.18.65 today. From reading the code, the early completion code in
those kernels happens to end the affected bitmap chunk as aborted.
We therefore plan to send one squashed patch for each to stable@.
If you or the stable maintainers prefer one patch for each mainline
commit, we can send that instead.
The analysis, the patches, their changelogs and the test script were
developed with AI coding assistants, then reviewed by Jason and me. The
results above come from the test runs described, not from the tools'
reasoning.
The patches are against md-7.5 (c526b7cd32f7) in the md tree and also
apply to v7.4-rc5.
Thanks,
Eric
The reproducer:
Run as root: sh md-raid10-sync-abort-repro.sh [test...]
It prints one RESULT line for each test and exits 1 if any test failed.
==== 8< ==== md-raid10-sync-abort-repro.sh ==== 8< ====
#!/bin/sh
# SPDX-License-Identifier: GPL-2.0
#
# Reproducers for lost write-intent bitmap state in md/raid10.
#
# Run as root:
#
# sh md-raid10-sync-abort-repro.sh [TEST...]
#
# TEST is one or more of:
#
# far-recovery bitmap recovery, far layout
# recovery-small-chunk bitmap recovery, 4 KiB chunks
# recovery-abort-far interrupted bitmap recovery, far layout,
# one returning member
# recovery-abort-offset interrupted bitmap recovery, offset layout,
# two returning members
# resync-abort interrupted resync with one bad block
# (needs dmsetup and dm-linear)
#
# With no argument, all five run. Each test prints one line
#
# RESULT test=<name> kernel=<uname -r> verdict=PASS|FAIL ...
#
# and the script exits 1 if any test failed.
#
# PASS means that every checked copy is current after md reports the
# array as idle and not degraded. FAIL means that md reports a healthy
# array while a member holds old data (recovery tests), or while two
# copies still differ in a region that the bitmap had marked dirty
# (resync test).
#
# Requirements: a kernel with raid10 and loop support, mdadm, losetup,
# blockdev, dd, cmp, tr, head and sha256sum.
#
# The script uses md$MD_NUM (default 127), loop devices on files under
# $WORK (default: a new directory under /tmp), and device-mapper names
# r10repro-*. It removes them on exit. It needs about 150 MiB in $WORK.
#
# Optional: MEMBERS="/dev/x /dev/y /dev/z" uses these three block
# devices (each at least 64 MiB, contents destroyed) instead of loop
# devices.
set -eu
MD_NUM=${MD_NUM:-127}
MD=/dev/md$MD_NUM
md=/sys/block/md$MD_NUM/md
WORK=${WORK:-}
MEMBERS=${MEMBERS:-}
# As in mdadm's own test suite: do not wait for udev, do not start units.
export MDADM_NO_UDEV=${MDADM_NO_UDEV:-1}
export MDADM_NO_SYSTEMCTL=${MDADM_NO_SYSTEMCTL:-1}
own_work=0
made_node=0
loops=""
dms=""
failed=0
die() {
echo "ERROR: $*" >&2
exit 2
}
stop_array() {
if [ -e "$md" ]; then
mdadm --stop "$MD" >/dev/null 2>&1 || true
fi
}
release_members() {
stop_array
for d in $dms; do
dmsetup remove "$d" >/dev/null 2>&1 || true
done
dms=""
for l in $loops; do
losetup -d "$l" >/dev/null 2>&1 || true
done
loops=""
}
cleanup() {
release_members
if [ "$made_node" = 1 ]; then
rm -f "$MD"
fi
if [ "$own_work" = 1 ]; then
rm -rf "$WORK"
fi
}
trap cleanup EXIT
# make_members COUNT SIZE_MIB: set M0..M(COUNT-1) to zero-filled devices.
make_members() {
count=$1
size_mib=$2
i=0
if [ -n "$MEMBERS" ]; then
for dev in $MEMBERS; do
[ "$i" -lt "$count" ] || break
dd if=/dev/zero of="$dev" bs=1M count="$size_mib" \
conv=fsync 2>/dev/null
eval "M$i=$dev"
i=$((i + 1))
done
[ "$i" -eq "$count" ] || die "MEMBERS must name $count devices"
return
fi
while [ "$i" -lt "$count" ]; do
rm -f "$WORK/member$i"
dd if=/dev/zero of="$WORK/member$i" bs=1M count="$size_mib" \
2>/dev/null
l=$(losetup -f)
losetup "$l" "$WORK/member$i"
loops="$loops $l"
eval "M$i=$l"
i=$((i + 1))
done
}
# Put a dm-linear device on top of M$1, so that its I/O can be held with
# "dmsetup suspend".
wrap_dm() {
eval "under=\$M$1"
sectors=$(blockdev --getsz "$under")
name=r10repro-$1
echo "0 $sectors linear $under 0" | dmsetup create "$name"
dms="$dms $name"
eval "M$1=/dev/mapper/$name"
}
md_node() {
if [ -e "$md/array_state" ] &&
[ "$(cat "$md/array_state")" != clear ]; then
die "md$MD_NUM is in use; set MD_NUM"
fi
if [ ! -e "$MD" ]; then
mknod "$MD" b 9 "$MD_NUM"
made_node=1
fi
}
# Print the md sysfs directory of the member in slot $1.
slot_dir() {
for d in "$md"/dev-*; do
if [ "$(cat "$d/slot")" = "$1" ]; then
echo "$d"
return
fi
done
die "no member in slot $1"
}
# wait_for SECONDS COMMAND...: poll until COMMAND succeeds.
wait_for() {
limit=$(($1 * 5))
shift
n=0
until "$@"; do
n=$((n + 1))
if [ "$n" -ge "$limit" ]; then
cat /proc/mdstat >&2
die "timed out waiting for: $*"
fi
sleep 0.2
done
}
is_idle() {
[ "$(cat "$md/sync_action")" = idle ]
}
is_idle_and_complete() {
is_idle && [ "$(cat "$md/degraded")" = 0 ]
}
# paused_at ACTION SECTOR: the sync thread waits at sync_max.
paused_at() {
read -r completed _ < "$md/sync_completed" || return 1
[ "$completed" = "$2" ] && [ "$(cat "$md/sync_action")" = "$1" ]
}
# Run "check" and print the number of sectors md found different.
scrub() {
echo check > "$md/sync_action"
sleep 1
wait_for 300 is_idle
cat "$md/mismatch_cnt"
}
# Make later raw reads of member devices come from the devices, not from
# stale page cache.
drop_member_cache() {
sync
for dev in "$@"; do
blockdev --flushbufs "$dev" 2>/dev/null || true
done
echo 3 > /proc/sys/vm/drop_caches
}
# read_member DEV SECTOR COUNT FILE: 512-byte sectors, absolute on DEV.
read_member() {
dd if="$1" of="$4" bs=512 skip="$2" count="$3" 2>/dev/null
}
# check_copy TEST MEMBER_INDEX SECTOR COUNT WANT_FILE: read one copy from a
# member, print what was found, and succeed if it matches WANT_FILE.
check_copy() {
eval "dev=\$M$2"
read_member "$dev" "$3" "$4" "$WORK/got"
want=$(sha256sum < "$5" | cut -c1-16)
got=$(sha256sum < "$WORK/got" | cut -c1-16)
echo "COPY test=$1 member=$2 dev=$dev sector=$3 count=$4" \
"want=$want got=$got"
[ "$want" = "$got" ]
}
pattern() {
head -c "$2" /dev/zero | tr '\000' "$1"
}
report() {
name=$1
verdict=$2
shift 2
echo "RESULT test=$name kernel=$(uname -r) verdict=$verdict $*"
if [ "$verdict" != PASS ]; then
failed=$((failed + 1))
fi
}
# --------------------------------------------------------------------
# far-recovery
#
# A member leaves a two-member far-2 array, data is written, and the member
# is re-added. Recovery is not interrupted.
# --------------------------------------------------------------------
test_far_recovery() {
make_members 2 64
md_node
mdadm --create "$MD" --run --quiet --assume-clean --metadata=1.2 \
--level=10 --layout=f2 --raid-devices=2 --chunk=64 \
--bitmap=internal --bitmap-chunk=1M "$M0" "$M1"
wait_for 30 is_idle
mdadm "$MD" --quiet --fail "$M1"
wait_for 30 mdadm "$MD" --quiet --remove "$M1"
[ "$(cat "$md/degraded")" = 1 ] || die "array is not degraded"
# 1 MiB of 'N' at 5, 20, 35 and 50 MiB while member 1 is out.
pattern N 1048576 > "$WORK/new"
for mib in 5 20 35 50; do
dd if="$WORK/new" of="$MD" bs=1M seek="$mib" count=1 \
oflag=direct conv=notrunc 2>/dev/null
done
sync
mdadm "$MD" --quiet --re-add "$M1"
wait_for 120 is_idle_and_complete
mismatches=$(scrub)
# Read the array from member 1 alone.
mdadm --stop "$MD" >/dev/null 2>&1
drop_member_cache "$M0" "$M1"
mdadm --assemble --run --readonly --quiet "$MD" "$M1" 2>/dev/null
stale=0
for mib in 5 20 35 50; do
dd if="$MD" of="$WORK/got" bs=1M skip="$mib" count=1 \
2>/dev/null
cmp -s "$WORK/new" "$WORK/got" || stale=$((stale + 1))
done
if [ "$stale" = 0 ] && [ "$mismatches" = 0 ]; then
verdict=PASS
else
verdict=FAIL
fi
report far-recovery "$verdict" \
"stale_regions_on_readded_member=$stale/4" \
"mismatch_cnt=$mismatches"
}
# --------------------------------------------------------------------
# recovery-small-chunk
#
# Three-member near-2 array with 4 KiB chunks and 64 KiB bitmap chunks.
# Member 1 leaves, every second 64 KiB of the first 1 MiB is written, and
# member 1 is re-added. Recovery is not interrupted. A clean range that is
# skipped must not carry the cursor past chunks that were not examined.
# --------------------------------------------------------------------
test_recovery_small_chunk() {
make_members 3 40
md_node
mdadm --create "$MD" --run --quiet --assume-clean --metadata=1.2 \
--level=10 --layout=n2 --raid-devices=3 --chunk=4 \
--bitmap=internal --bitmap-chunk=64K --size=32768 \
"$M0" "$M1" "$M2"
wait_for 30 is_idle
mdadm "$MD" --quiet --fail "$M1"
wait_for 30 mdadm "$MD" --quiet --remove "$M1"
[ "$(cat "$md/degraded")" = 1 ] || die "array is not degraded"
pattern N 65536 > "$WORK/new"
for k in 1 3 5 7 9 11 13 15; do
dd if="$WORK/new" of="$MD" bs=65536 seek="$k" count=1 \
oflag=direct conv=notrunc 2>/dev/null
done
sync
mdadm "$MD" --quiet --re-add "$M1"
wait_for 120 is_idle_and_complete
mismatches=$(scrub)
# Fail member 0, so that every block that has a copy on member 1
# and member 0 is now read from member 1.
mdadm "$MD" --quiet --fail "$M0"
drop_member_cache "$MD"
stale=0
for k in 1 3 5 7 9 11 13 15; do
dd if="$MD" of="$WORK/got" bs=65536 skip="$k" count=1 \
iflag=direct 2>/dev/null
cmp -s "$WORK/new" "$WORK/got" || stale=$((stale + 1))
done
if [ "$stale" = 0 ] && [ "$mismatches" = 0 ]; then
verdict=PASS
else
verdict=FAIL
fi
report recovery-small-chunk "$verdict" \
"stale_regions_read_without_member0=$stale/8" \
"mismatch_cnt=$mismatches"
}
# --------------------------------------------------------------------
# recovery-abort-far
#
# Three-member far-2 array, 64 KiB chunks, 256 KiB bitmap chunks. Member 1
# leaves, two 64 KiB chunks are written, member 1 is re-added. Recovery
# pauses at sync_max = 256 sectors and is stopped there with "frozen", then
# resumed. The two far copies on member 1 are behind the checkpoint in
# bitmap terms but not yet copied.
# --------------------------------------------------------------------
test_recovery_abort_far() {
make_members 3 40
md_node
mdadm --create "$MD" --run --quiet --assume-clean --metadata=1.2 \
--level=10 --layout=f2 --raid-devices=3 --chunk=64 \
--bitmap=internal --bitmap-chunk=256K --size=32768 \
--data-offset=1M "$M0" "$M1" "$M2"
wait_for 30 is_idle
offset=$(cat "$(slot_dir 1)/offset")
# For far-2 the second copy starts this many sectors into each member.
stride=$(cat "$md/component_size")
mdadm "$MD" --quiet --fail "$M1"
wait_for 30 mdadm "$MD" --quiet --remove "$M1"
[ "$(cat "$md/degraded")" = 1 ] || die "array is not degraded"
pattern A 65536 > "$WORK/expect0"
pattern B 65536 > "$WORK/expect3"
dd if="$WORK/expect0" of="$MD" bs=65536 seek=0 count=1 \
oflag=direct conv=notrunc 2>/dev/null
dd if="$WORK/expect3" of="$MD" bs=65536 seek=3 count=1 \
oflag=direct conv=notrunc 2>/dev/null
sync
echo 256 > "$md/sync_max"
mdadm "$MD" --quiet --re-add "$M1"
wait_for 60 paused_at recover 256
echo frozen > "$md/sync_action"
echo max > "$md/sync_max"
echo recover > "$md/sync_action"
wait_for 120 is_idle_and_complete
mismatches=$(scrub)
mdadm --stop "$MD" >/dev/null 2>&1
drop_member_cache "$M0" "$M1" "$M2"
stale=0
for i in 0 3; do
sector=$((offset + stride + (i / 3) * 128))
check_copy recovery-abort-far 1 "$sector" 128 \
"$WORK/expect$i" || stale=$((stale + 1))
done
if [ "$stale" = 0 ] && [ "$mismatches" = 0 ]; then
verdict=PASS
else
verdict=FAIL
fi
report recovery-abort-far "$verdict" \
"stale_copies_on_readded_member=$stale/2" \
"mismatch_cnt=$mismatches"
}
# --------------------------------------------------------------------
# recovery-abort-offset
#
# Three-member offset-3 array, 64 KiB chunks, 32 KiB bitmap chunks. Members
# 0 and 1 leave, two 32 KiB blocks are written, both members are re-added.
# Recovery is stopped at sync_max = 256 sectors and resumed. A bitmap chunk
# started for one returning member still has a copy outstanding on the
# other.
# --------------------------------------------------------------------
test_recovery_abort_offset() {
make_members 3 40
md_node
mdadm --create "$MD" --run --quiet --assume-clean --metadata=1.2 \
--level=10 --layout=o3 --raid-devices=3 --chunk=64 \
--bitmap=internal --bitmap-chunk=32K --size=32768 \
--data-offset=1M "$M0" "$M1" "$M2"
wait_for 30 is_idle
offset=$(cat "$(slot_dir 1)/offset")
echo frozen > "$md/sync_action"
mdadm "$MD" --quiet --fail "$M0"
wait_for 30 mdadm "$MD" --quiet --remove "$M0"
mdadm "$MD" --quiet --fail "$M1"
wait_for 30 mdadm "$MD" --quiet --remove "$M1"
[ "$(cat "$md/degraded")" = 2 ] || die "array is not doubly degraded"
pattern A 32768 > "$WORK/expect0"
pattern B 32768 > "$WORK/expect3"
dd if="$WORK/expect0" of="$MD" bs=32768 seek=0 count=1 \
oflag=direct conv=notrunc 2>/dev/null
dd if="$WORK/expect3" of="$MD" bs=32768 seek=3 count=1 \
oflag=direct conv=notrunc 2>/dev/null
sync
echo 256 > "$md/sync_max"
mdadm "$MD" --quiet --re-add "$M0"
mdadm "$MD" --quiet --re-add "$M1"
echo recover > "$md/sync_action"
wait_for 60 paused_at recover 256
echo frozen > "$md/sync_action"
echo max > "$md/sync_max"
echo recover > "$md/sync_action"
wait_for 120 is_idle_and_complete
mismatches=$(scrub)
mdadm --stop "$MD" >/dev/null 2>&1
drop_member_cache "$M0" "$M1" "$M2"
stale=0
for v in 0 3; do
for i in 0 1 2; do
# Member sector of the copy of block $v on member $i.
if [ "$v" = 0 ]; then
p=$((128 * i))
else
p=$((64 + 128 * ((i + 2) % 3)))
fi
check_copy recovery-abort-offset "$i" $((offset + p)) \
64 "$WORK/expect$v" || stale=$((stale + 1))
done
done
if [ "$stale" = 0 ] && [ "$mismatches" = 0 ]; then
verdict=PASS
else
verdict=FAIL
fi
report recovery-abort-offset "$verdict" \
"stale_copies=$stale/6" "mismatch_cnt=$mismatches"
}
# --------------------------------------------------------------------
# resync-abort
#
# Two-member near-2 array, 4 KiB chunks, 1 MiB bitmap chunks (2048 sectors).
# Bitmap chunks 0 and 1 are dirty, as after an unclean shutdown. The two
# copies of sector 3048 (in bitmap chunk 1) differ. Member 0 has one bad
# block at sector 2043, five sectors before the end of bitmap chunk 0.
#
# The resync pauses at sync_max = 2040. It is then allowed to run to 2048
# while member 1 is suspended, so that it stops with its cursor at 2044:
#
# [2040, 2043) read submitted, held by the suspended member
# [2043, 2044) bad block on member 0, only one copy readable,
# skipped. This call asks the bitmap about the page
# that starts at 2043. The page crosses into bitmap
# chunk 1, which is marked in progress.
# 2044 md waits for the held read before it goes on
#
# "frozen" interrupts the resync there. The interrupted resync is then
# restarted and runs to the end.
# --------------------------------------------------------------------
test_resync_abort() {
command -v dmsetup >/dev/null 2>&1 || {
echo "SKIP test=resync-abort (no dmsetup)"
return
}
make_members 2 16
wrap_dm 0
wrap_dm 1
md_node
mdadm --create "$MD" --run --quiet --assume-clean --metadata=1.2 \
--level=10 --layout=n2 --raid-devices=2 --chunk=4 \
--bitmap=internal --bitmap-chunk=1M --size=4096 \
"$M0" "$M1"
wait_for 30 is_idle
offset=$(cat "$(slot_dir 0)/offset")
[ "$offset" = "$(cat "$(slot_dir 1)/offset")" ] ||
die "members have different data offsets"
[ "$(cat "$md/bitmap/chunksize")" = 1048576 ] ||
die "unexpected bitmap chunk size"
# Same data on both copies, then make sector 3048 differ on member 1,
# as a write interrupted by a crash would.
pattern A 4194304 > "$WORK/fill"
dd if="$WORK/fill" of="$MD" bs=1M count=4 oflag=direct 2>/dev/null
sync
mdadm --stop "$MD" >/dev/null 2>&1
pattern B 512 > "$WORK/torn"
dd if="$WORK/torn" of="$M1" bs=512 seek=$((offset + 3048)) count=1 \
conv=notrunc,fsync 2>/dev/null
drop_member_cache "$M0" "$M1"
# On a host with udev, the write above can make udev assemble the
# array again on its own. Wait for it and stop that array, so that
# the assembly below is the only one.
if command -v udevadm >/dev/null 2>&1; then
udevadm settle || true
fi
stop_array
mdadm --assemble --run --quiet "$MD" "$M0" "$M1"
wait_for 30 is_idle
echo frozen > "$md/sync_action"
echo "$((offset + 2043)) 1" > "$(slot_dir 0)/bad_blocks"
echo "0 1" > "$md/bitmap_set_bits"
echo 2040 > "$md/sync_max"
echo resync > "$md/sync_action"
wait_for 60 paused_at resync 2040
dmsetup suspend r10repro-1
echo 2048 > "$md/sync_max"
sleep 1
echo frozen > "$md/sync_action" &
sleep 1
dmsetup resume r10repro-1
wait
[ "$(cat "$md/sync_action")" = frozen ] || die "resync was not stopped"
# Where md recorded the interrupted resync as having got to.
stopped_at=$(cat "$md/resync_start")
echo max > "$md/sync_max"
echo resync > "$md/sync_action"
sleep 1
wait_for 120 is_idle
mismatches=$(scrub)
mdadm --stop "$MD" >/dev/null 2>&1
drop_member_cache "$M0" "$M1"
# The resync copies member 0 over member 1, so both must hold 'A'.
head -c 512 "$WORK/fill" > "$WORK/expect"
copies=equal
check_copy resync-abort 0 $((offset + 3048)) 1 "$WORK/expect" ||
copies=differ
check_copy resync-abort 1 $((offset + 3048)) 1 "$WORK/expect" ||
copies=differ
if [ "$copies" = equal ] && [ "$mismatches" = 0 ]; then
verdict=PASS
else
verdict=FAIL
fi
report resync-abort "$verdict" "stopped_at=$stopped_at" \
"copies_of_sector_3048=$copies" "mismatch_cnt=$mismatches"
}
run_test() {
case "$1" in
far-recovery) test_far_recovery ;;
recovery-small-chunk) test_recovery_small_chunk ;;
recovery-abort-far) test_recovery_abort_far ;;
recovery-abort-offset) test_recovery_abort_offset ;;
resync-abort) test_resync_abort ;;
*) die "unknown test $1" ;;
esac
release_members
}
[ "$(id -u)" = 0 ] || die "run as root"
if [ -z "$WORK" ]; then
WORK=$(mktemp -d /tmp/r10repro.XXXXXX)
own_work=1
fi
mkdir -p "$WORK"
echo "kernel: $(uname -r)"
echo "mdadm: $(mdadm --version 2>&1)"
[ $# -gt 0 ] ||
set -- far-recovery recovery-small-chunk recovery-abort-far \
recovery-abort-offset resync-abort
for t in "$@"; do
echo "--- $t"
run_test "$t"
done
if [ "$failed" = 0 ]; then
echo "All tests passed."
else
echo "$failed test(s) failed."
exit 1
fi
==== 8< ==== end of script ==== 8< ====
Jason Chu (3):
md/raid10: do not skip past the range that sync_request examined
md/raid10: re-arm in-progress bitmap chunks when recovery is
interrupted
md/raid10: keep look-ahead bitmap chunks when resync is interrupted
drivers/md/raid10.c | 89 +++++++++++++++++++++++++++++++++++++++++++--
1 file changed, 85 insertions(+), 4 deletions(-)
--
2.43.7
^ permalink raw reply [flat|nested] 10+ messages in thread
* [PATCH RESEND 1/3] md/raid10: do not skip past the range that sync_request examined
2026-12-04 17:46 ` [PATCH RESEND 0/3] md/raid10: fix old data left by skipped and interrupted sync Eric Hagberg
@ 2026-12-04 17:46 ` Eric Hagberg
2026-12-04 17:46 ` [PATCH RESEND 2/3] md/raid10: re-arm in-progress bitmap chunks when recovery is interrupted Eric Hagberg
2026-12-04 17:46 ` [PATCH RESEND 3/3] md/raid10: keep look-ahead bitmap chunks when resync " Eric Hagberg
2 siblings, 0 replies; 10+ messages in thread
From: Eric Hagberg @ 2026-12-04 17:46 UTC (permalink / raw)
To: Song Liu, Yu Kuai
Cc: Jason Chu, Li Nan, Xiao Ni, linux-raid, linux-kernel,
Eric Hagberg
From: Jason Chu <jaschu@janestreet.com>
When a range needs no I/O, raid10_sync_request() returns the number of
sectors that md may skip. Before it looks at a range it lowers max_sector
to resync_max and, if near_copies < raid_disks, to the end of the current
chunk, because the mapping between member sectors and array sectors
changes at every chunk boundary. The bitmap and the bad block lists are
then consulted for that range only.
Since commit 7435b73f05fb ("md/raid10: cleanup skip handling in
raid10_sync_request") the two "nothing to do here" paths return max_sync.
max_sync is limited by what the bitmap says about the array sector that
sector_nr maps to, and by bad blocks, but not by max_sector. It can be as
large as RESYNC_BLOCK_SIZE, which is 64KiB.
During recovery of an array with near_copies < raid_disks and a chunk
size below 64KiB, one clean chunk therefore makes md advance over the
following chunks of the same member. Those chunks hold other array
sectors, and the bitmap is never asked about them. If they are dirty
their copies are not rebuilt, the member is still marked In_sync, and
reads from it return old data.
Before that commit the giveup path limited the skip to the examined
range:
if (sector_nr + max_sync < max_sector)
max_sector = sector_nr + max_sync;
sectors_skipped += (max_sector - sector_nr);
Reproduced on v7.4-rc5 in a KVM guest with the "recovery-small-chunk" test
of the script in the cover letter: 3 members, near=2, 4KiB chunks, 64KiB
bitmap chunks; member 1 is removed, eight 64KiB regions are written, and
member 1 is re-added. Recovery is not interrupted.
before: verdict=FAIL stale_regions_read_without_member0=8/8
mismatch_cnt=320
after: verdict=PASS stale_regions_read_without_member0=0/8
mismatch_cnt=0
The same test passes on 6.12.117, which does not have 7435b73f05fb.
Return the smaller of max_sync and the examined range from the recovery
path. Do the same in the resync path that is taken when fewer than two
copies are readable: its bad block lookups are for the member addresses of
the current chunk, and it must not pass resync_max either. The resync
path was changed by reading the code; the reproducer covers the recovery
path only.
Two other returns are not changed. The clean-bitmap return in the resync
path ("We can skip this block") can still move the cursor past
resync_max, without doing I/O there. The return after a failed
bio_add_page() still returns max_sync.
Fixes: 7435b73f05fb ("md/raid10: cleanup skip handling in raid10_sync_request")
Cc: stable@vger.kernel.org
Signed-off-by: Jason Chu <jaschu@janestreet.com>
Signed-off-by: Eric Hagberg <ehagberg@janestreet.com>
---
drivers/md/raid10.c | 11 +++++++++--
1 file changed, 9 insertions(+), 2 deletions(-)
diff --git a/drivers/md/raid10.c b/drivers/md/raid10.c
index 066c431..3ef0143 100644
--- a/drivers/md/raid10.c
+++ b/drivers/md/raid10.c
@@ -3457,8 +3457,14 @@ static sector_t raid10_sync_request(struct mddev *mddev, sector_t sector_nr,
rb2->master_bio = NULL;
put_buf(rb2);
}
+ /*
+ * Only this range was examined: it ends at
+ * resync_max and at the chunk boundary where the
+ * mapping changes.
+ */
*skipped = 1;
- return max_sync;
+ return min_t(sector_t, max_sync,
+ max_sector - sector_nr);
}
} else {
/* resync. Schedule a read for every block at this virt offset */
@@ -3575,7 +3581,8 @@ static sector_t raid10_sync_request(struct mddev *mddev, sector_t sector_nr,
}
put_buf(r10_bio);
*skipped = 1;
- return max_sync;
+ return min_t(sector_t, max_sync,
+ max_sector - sector_nr);
}
}
--
2.43.7
^ permalink raw reply related [flat|nested] 10+ messages in thread
* [PATCH RESEND 2/3] md/raid10: re-arm in-progress bitmap chunks when recovery is interrupted
2026-12-04 17:46 ` [PATCH RESEND 0/3] md/raid10: fix old data left by skipped and interrupted sync Eric Hagberg
2026-12-04 17:46 ` [PATCH RESEND 1/3] md/raid10: do not skip past the range that sync_request examined Eric Hagberg
@ 2026-12-04 17:46 ` Eric Hagberg
2026-12-04 18:16 ` sashiko-bot
2026-12-04 17:46 ` [PATCH RESEND 3/3] md/raid10: keep look-ahead bitmap chunks when resync " Eric Hagberg
2 siblings, 1 reply; 10+ messages in thread
From: Eric Hagberg @ 2026-12-04 17:46 UTC (permalink / raw)
To: Song Liu, Yu Kuai
Cc: Jason Chu, Li Nan, Xiao Ni, linux-raid, linux-kernel,
Eric Hagberg
From: Jason Chu <jaschu@janestreet.com>
Recovery walks member sectors, but the write-intent bitmap tracks array
sectors. When raid10_sync_request() finds work at a member sector it
calls md_bitmap_start_sync() for the array sector that maps to it. With
the classic bitmap this moves the bitmap chunk from NEEDED to RESYNC. The
same bitmap chunk can cover copies at member sectors that recovery has
not reached yet:
- With the far layout, a bitmap chunk larger than the raid chunk covers
array chunks whose copies on the recovering member are far apart: near
the start of the member for one array chunk, and in the far section
for the next.
- With two members recovering together, a bitmap chunk is started when
the cursor reaches the copy on one member. The copy of the same data
on the other member can be at a later member sector.
When recovery is interrupted, the final call to raid10_sync_request()
ends only the chunks that curr_resync maps to, one per slot.
bitmap_close_sync() then clears RESYNC on all other chunks without
setting NEEDED, as if their work was done. md saves curr_resync as the
recovery offset. When recovery resumes from there, start_sync() reports
those chunks as clean, the remaining copies are skipped, and the member
is marked In_sync while it holds old data.
No device error is needed. Writing "frozen" to sync_action during a
bitmap based recovery, and then letting recovery continue, is enough.
Reproduced on v7.4-rc5 in a KVM guest with the script in the cover
letter. Both tests stop recovery with "frozen" while it is paused at
sync_max, and then let it finish:
recovery-abort-far (3 members, far=2, one member re-added)
before: verdict=FAIL stale_copies_on_readded_member=2/2
mismatch_cnt=256
after: verdict=PASS stale_copies_on_readded_member=0/2
mismatch_cnt=0
recovery-abort-offset (3 members, offset=3, two members re-added)
before: verdict=FAIL stale_copies=1/6 mismatch_cnt=64
after: verdict=PASS stale_copies=0/6 mismatch_cnt=0
On an aborted recovery with the classic bitmap, do not call close_sync().
Walk the bitmap and end every chunk as aborted, which turns RESYNC back
into NEEDED. A chunk whose copies were all finished before the
interruption stays dirty and is copied again later. That is extra work,
but no copy is skipped.
The walk steps by the span that end_sync() reports. A counter page that
is missing or hijacked reports the span of a whole page, and a hijacked
page has one counter for each half, so the walk also visits the last
sector of such a span.
llbitmap is left alone: llbitmap_end_sync() already aborts every syncing
chunk from the given offset to the end of the bitmap. llbitmap was not
tested.
Fixes: 6cce3b23f6f8 ("[PATCH] md: write intent bitmap support for raid10")
Cc: stable@vger.kernel.org
Signed-off-by: Jason Chu <jaschu@janestreet.com>
Signed-off-by: Eric Hagberg <ehagberg@janestreet.com>
---
drivers/md/raid10.c | 59 +++++++++++++++++++++++++++++++++++++++++++--
1 file changed, 57 insertions(+), 2 deletions(-)
diff --git a/drivers/md/raid10.c b/drivers/md/raid10.c
index 3ef0143..e42abe7 100644
--- a/drivers/md/raid10.c
+++ b/drivers/md/raid10.c
@@ -3071,6 +3071,51 @@ static void raid10_set_cluster_sync_high(struct r10conf *conf)
conf->cluster_sync_high = conf->cluster_sync_low + window_size;
}
+/*
+ * llbitmap's end_sync already aborts every syncing chunk from the given
+ * offset to the end. The classic bitmap ends one chunk per call.
+ */
+static bool raid10_classic_bitmap(struct mddev *mddev)
+{
+ return mddev->bitmap_id == ID_BITMAP && md_bitmap_enabled(mddev, false);
+}
+
+/*
+ * Re-arm the classic bitmap's in-progress chunks from @start to the end of
+ * the array, so that they are synced again.
+ *
+ * Recovery walks member sectors, but the bitmap tracks array sectors. A
+ * chunk that was started for one copy can still cover copies that recovery
+ * has not reached: on another returning member, or further into the same
+ * member for the far layout. An aborted recovery therefore re-arms every
+ * in-progress chunk (@start == 0). A chunk whose copies are all done may
+ * stay dirty and be copied again, but an unfinished copy is not skipped.
+ */
+static void raid10_abort_sync_bitmap(struct mddev *mddev, sector_t start)
+{
+ /* The bitmap chunk size is a power of two. */
+ sector_t chunk_sectors = mddev->bitmap_info.chunksize >> SECTOR_SHIFT;
+ sector_t limit = mddev->resync_max_sectors;
+ sector_t sector = round_down(start, chunk_sectors);
+
+ while (sector < limit) {
+ sector_t blocks;
+
+ mddev->bitmap_ops->end_sync(mddev, sector, &blocks);
+ blocks = min(blocks, limit - sector);
+ sector += blocks;
+ /*
+ * Missing and hijacked counter pages report a whole page
+ * span. A hijacked page has two counters, one for each
+ * half. Visit the last sector of the span as well, in
+ * case it uses the other counter.
+ */
+ if (blocks > chunk_sectors)
+ mddev->bitmap_ops->end_sync(mddev, sector - 1, &blocks);
+ cond_resched();
+ }
+}
+
/*
* perform a "sync" on one "block"
*
@@ -3136,6 +3181,8 @@ static sector_t raid10_sync_request(struct mddev *mddev, sector_t sector_nr,
return 0;
if (sector_nr >= max_sector) {
+ bool aborted = mddev->curr_resync < max_sector;
+
conf->cluster_sync_low = 0;
conf->cluster_sync_high = 0;
@@ -3154,7 +3201,7 @@ static sector_t raid10_sync_request(struct mddev *mddev, sector_t sector_nr,
return 0;
}
- if (mddev->curr_resync < max_sector) { /* aborted */
+ if (aborted) {
if (test_bit(MD_RECOVERY_SYNC, &mddev->recovery))
md_bitmap_end_sync(mddev, mddev->curr_resync,
&sync_blocks);
@@ -3182,8 +3229,16 @@ static sector_t raid10_sync_request(struct mddev *mddev, sector_t sector_nr,
}
conf->fullsync = 0;
}
- if (md_bitmap_enabled(mddev, false))
+ if (aborted && raid10_classic_bitmap(mddev) &&
+ !test_bit(MD_RECOVERY_SYNC, &mddev->recovery)) {
+ /*
+ * close_sync would clear in-progress chunks that
+ * still have copies outstanding.
+ */
+ raid10_abort_sync_bitmap(mddev, 0);
+ } else if (md_bitmap_enabled(mddev, false)) {
mddev->bitmap_ops->close_sync(mddev);
+ }
close_sync(conf);
*skipped = 1;
return 0;
--
2.43.7
^ permalink raw reply related [flat|nested] 10+ messages in thread
* [PATCH RESEND 3/3] md/raid10: keep look-ahead bitmap chunks when resync is interrupted
2026-12-04 17:46 ` [PATCH RESEND 0/3] md/raid10: fix old data left by skipped and interrupted sync Eric Hagberg
2026-12-04 17:46 ` [PATCH RESEND 1/3] md/raid10: do not skip past the range that sync_request examined Eric Hagberg
2026-12-04 17:46 ` [PATCH RESEND 2/3] md/raid10: re-arm in-progress bitmap chunks when recovery is interrupted Eric Hagberg
@ 2026-12-04 17:46 ` Eric Hagberg
2026-12-04 18:09 ` sashiko-bot
2 siblings, 1 reply; 10+ messages in thread
From: Eric Hagberg @ 2026-12-04 17:46 UTC (permalink / raw)
To: Song Liu, Yu Kuai
Cc: Jason Chu, Li Nan, Xiao Ni, linux-raid, linux-kernel,
Eric Hagberg
From: Jason Chu <jaschu@janestreet.com>
bitmap_start_sync() always covers at least one page worth of sectors from
the offset it is given. If fewer sectors than that remain in the bitmap
chunk that holds the offset, it also moves the next chunk from NEEDED to
RESYNC. Call this the look-ahead.
A resync reaches such an offset when a bad block has shortened an earlier
window, so that the cursor is no longer page aligned. From reading the
code, it also does so whenever the bitmap chunk is smaller than a page.
If the resync is interrupted while the cursor is still inside the first
chunk, the final call to raid10_sync_request() ends the chunk at
curr_resync only. bitmap_close_sync() then clears RESYNC on the
look-ahead chunk without setting NEEDED. The restarted resync skips that
chunk as clean, and copies that differ inside it are not made equal.
Reproduced in a KVM guest with the "resync-abort" test of the script in
the cover letter: 2 members, near=2, 4KiB chunks, 1MiB bitmap chunks,
bitmap chunks 0 and 1 dirty, one bad block on member 0 five sectors
before the end of bitmap chunk 0, and the two copies of one sector in
bitmap chunk 1 different. The test holds the I/O of one member to stop
the resync with its cursor between the bad block and the end of bitmap
chunk 0, then restarts the resync and lets it finish:
v7.4-rc5 with the two previous patches:
verdict=FAIL stopped_at=2044 copies_of_sector_3048=differ
mismatch_cnt=128
with this patch:
verdict=PASS stopped_at=2044 copies_of_sector_3048=equal
mismatch_cnt=0
On an aborted resync with the classic bitmap, re-arm the in-progress
chunks from the one that holds curr_resync to the end, then call
close_sync() as before. md has waited for all resync I/O before the
final call, so the chunks below curr_resync are complete and can be
closed. A resync that is interrupted and restarted again and again
therefore still makes progress.
curr_resync can hold one of the MD_RESYNC_* markers instead of a sector
when the resync is interrupted before its first step. Walk from sector 0
in that case.
The cost is a second walk over the bitmap counters when a resync is
aborted.
Fixes: 1187cf0a3c8b ("md: Allow write-intent bitmaps to have chunksize < PAGE_SIZE")
Cc: stable@vger.kernel.org
Signed-off-by: Jason Chu <jaschu@janestreet.com>
Signed-off-by: Eric Hagberg <ehagberg@janestreet.com>
---
drivers/md/raid10.c | 19 +++++++++++++++++++
1 file changed, 19 insertions(+)
diff --git a/drivers/md/raid10.c b/drivers/md/raid10.c
index e42abe7..2de4ec1 100644
--- a/drivers/md/raid10.c
+++ b/drivers/md/raid10.c
@@ -3090,6 +3090,12 @@ static bool raid10_classic_bitmap(struct mddev *mddev)
* member for the far layout. An aborted recovery therefore re-arms every
* in-progress chunk (@start == 0). A chunk whose copies are all done may
* stay dirty and be copied again, but an unfinished copy is not skipped.
+ *
+ * Resync looks ahead: bitmap start_sync puts at least a page worth of
+ * sectors from the cursor in progress, which can include the chunk after
+ * the one that holds the cursor. An aborted resync re-arms the chunks from
+ * the one that holds the cursor onward. The caller then closes the chunks
+ * behind it, whose I/O has completed, so that progress is kept.
*/
static void raid10_abort_sync_bitmap(struct mddev *mddev, sector_t start)
{
@@ -3236,6 +3242,19 @@ static sector_t raid10_sync_request(struct mddev *mddev, sector_t sector_nr,
* still have copies outstanding.
*/
raid10_abort_sync_bitmap(mddev, 0);
+ } else if (aborted && raid10_classic_bitmap(mddev)) {
+ sector_t start = mddev->curr_resync;
+
+ /* An MD_RESYNC_* marker, or within the first sectors. */
+ if (start <= MD_RESYNC_ACTIVE)
+ start = 0;
+ /*
+ * All resync I/O below curr_resync has completed.
+ * Re-arm the look-ahead from there, then close the
+ * chunks behind it as a completed sync would.
+ */
+ raid10_abort_sync_bitmap(mddev, start);
+ mddev->bitmap_ops->close_sync(mddev);
} else if (md_bitmap_enabled(mddev, false)) {
mddev->bitmap_ops->close_sync(mddev);
}
--
2.43.7
^ permalink raw reply related [flat|nested] 10+ messages in thread
* Re: [PATCH RESEND 3/3] md/raid10: keep look-ahead bitmap chunks when resync is interrupted
2026-12-04 17:46 ` [PATCH RESEND 3/3] md/raid10: keep look-ahead bitmap chunks when resync " Eric Hagberg
@ 2026-12-04 18:09 ` sashiko-bot
2026-12-04 19:18 ` Eric Hagberg
0 siblings, 1 reply; 10+ messages in thread
From: sashiko-bot @ 2026-12-04 18:09 UTC (permalink / raw)
To: Eric Hagberg; +Cc: linux-raid, yukuai
Thank you for your contribution! Sashiko AI review found 1 potential
issue to consider:
- [Low] md/raid10: work around md-bitmap look-ahead abort outside
bitmap_ops
--
commit 2f5ce3b658bf9a2eba7806615e7dfc7c6a6d52dd
Author: Jason Chu <jaschu@janestreet.com>
md/raid10: keep look-ahead bitmap chunks when resync is interrupted
This commit updates raid10_sync_request() so that an aborted resync with
the classic bitmap re-arms in-progress bitmap chunks from curr_resync
onward via raid10_abort_sync_bitmap() before calling close_sync().
> diff --git a/drivers/md/raid10.c b/drivers/md/raid10.c
> index e42abe747d81b..2de4ec14e32f7 100644
> --- a/drivers/md/raid10.c
> +++ b/drivers/md/raid10.c
[ ... ]
> @@ -3236,6 +3242,19 @@ static sector_t raid10_sync_request(struct mddev *mddev, sector_t sector_nr,
> * still have copies outstanding.
> */
> raid10_abort_sync_bitmap(mddev, 0);
> + } else if (aborted && raid10_classic_bitmap(mddev)) {
> + sector_t start = mddev->curr_resync;
> +
> + /* An MD_RESYNC_* marker, or within the first sectors. */
> + if (start <= MD_RESYNC_ACTIVE)
> + start = 0;
> + /*
> + * All resync I/O below curr_resync has completed.
> + * Re-arm the look-ahead from there, then close the
> + * chunks behind it as a completed sync would.
> + */
> + raid10_abort_sync_bitmap(mddev, start);
> + mddev->bitmap_ops->close_sync(mddev);
> } else if (md_bitmap_enabled(mddev, false)) {
> mddev->bitmap_ops->close_sync(mddev);
> }
[Severity: Low]
Should this look-ahead abort handling live behind struct bitmap_operations
in drivers/md/md-bitmap.c instead of extending the raid10-local workaround?
Unlike recovery geometry, the look-ahead behavior comes from
bitmap_start_sync() in md-bitmap.c itself. Handling it here couples a
second path in raid10_sync_request() to classic-bitmap internals via
raid10_classic_bitmap() and raid10_abort_sync_bitmap().
In particular, raid10.c checks bitmap_id == ID_BITMAP, relies on
bitmap_info.chunksize, and probes sector - 1 for md_bitmap_get_counter()'s
hijacked two-counter pages. An aborted resync also walks the bitmap
counters twice via raid10_abort_sync_bitmap() and close_sync().
Extending struct bitmap_operations with an abort/close boundary would let
md-bitmap.c close [0, start) and re-arm [start, limit) in a single pass
with direct access to bitmap->counts and bp[page].hijacked, without
leaking classic-bitmap details into raid10.c.
--
Sashiko AI review · https://sashiko.dev/#/patchset/20261204174621.3475573-1-ehagberg@janestreet.com?part=3
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH RESEND 2/3] md/raid10: re-arm in-progress bitmap chunks when recovery is interrupted
2026-12-04 17:46 ` [PATCH RESEND 2/3] md/raid10: re-arm in-progress bitmap chunks when recovery is interrupted Eric Hagberg
@ 2026-12-04 18:16 ` sashiko-bot
2026-12-04 19:17 ` Eric Hagberg
0 siblings, 1 reply; 10+ messages in thread
From: sashiko-bot @ 2026-12-04 18:16 UTC (permalink / raw)
To: Eric Hagberg; +Cc: linux-raid, yukuai
Thank you for your contribution! Sashiko AI review found 3 potential
issues to consider:
- [Medium] md/raid10: raid10_abort_sync_bitmap() permanently leaves
NEEDED_MASK set
- [Low] md/raid10: raid10_abort_sync_bitmap() couples to md-bitmap
internals
- [Low] md/raid10: misleading llbitmap abort rationale in
raid10_classic_bitmap()
--
commit 0d112aed9e653ad59e91dbedbc2614b80f007e0e
Author: Jason Chu <jaschu@janestreet.com>
md/raid10: re-arm in-progress bitmap chunks when recovery is interrupted
When a classic-bitmap raid10 recovery is aborted, this commit walks the
bitmap from sector 0 and calls end_sync() on every chunk instead of
calling bitmap_ops->close_sync(), so in-progress chunks with remaining
copies keep NEEDED_MASK set.
> diff --git a/drivers/md/raid10.c b/drivers/md/raid10.c
> index 3ef0143acfd97..e42abe747d81b 100644
> --- a/drivers/md/raid10.c
> +++ b/drivers/md/raid10.c
> @@ -3071,6 +3071,51 @@ static void raid10_set_cluster_sync_high(struct r10conf *conf)
> conf->cluster_sync_high = conf->cluster_sync_low + window_size;
> }
>
> +/*
> + * llbitmap's end_sync already aborts every syncing chunk from the given
> + * offset to the end. The classic bitmap ends one chunk per call.
> + */
> +static bool raid10_classic_bitmap(struct mddev *mddev)
> +{
> + return mddev->bitmap_id == ID_BITMAP && md_bitmap_enabled(mddev, false);
> +}
[Severity: Low]
Is this rationale (and the matching note in the commit message) accurate
for aborted recovery?
On aborted recovery, raid10_sync_request() passes virtual offsets from
raid10_find_virt(conf, mddev->curr_resync, i) rather than 0, so
llbitmap_end_sync() only aborts chunks from those offsets to the end.
llbitmap_close_sync() then transitions lower syncing chunks to BitDirty
rather than BitNeedSync, so avoiding skipped copies depends on llbitmap's
degraded-array BitDirty handling instead.
> +
> +/*
> + * Re-arm the classic bitmap's in-progress chunks from @start to the end of
> + * the array, so that they are synced again.
> + *
> + * Recovery walks member sectors, but the bitmap tracks array sectors. A
> + * chunk that was started for one copy can still cover copies that recovery
> + * has not reached: on another returning member, or further into the same
> + * member for the far layout. An aborted recovery therefore re-arms every
> + * in-progress chunk (@start == 0). A chunk whose copies are all done may
> + * stay dirty and be copied again, but an unfinished copy is not skipped.
> + */
> +static void raid10_abort_sync_bitmap(struct mddev *mddev, sector_t start)
> +{
> + /* The bitmap chunk size is a power of two. */
> + sector_t chunk_sectors = mddev->bitmap_info.chunksize >> SECTOR_SHIFT;
> + sector_t limit = mddev->resync_max_sectors;
> + sector_t sector = round_down(start, chunk_sectors);
> +
> + while (sector < limit) {
> + sector_t blocks;
> +
> + mddev->bitmap_ops->end_sync(mddev, sector, &blocks);
> + blocks = min(blocks, limit - sector);
> + sector += blocks;
> + /*
> + * Missing and hijacked counter pages report a whole page
> + * span. A hijacked page has two counters, one for each
> + * half. Visit the last sector of the span as well, in
> + * case it uses the other counter.
> + */
> + if (blocks > chunk_sectors)
> + mddev->bitmap_ops->end_sync(mddev, sector - 1, &blocks);
> + cond_resched();
> + }
> +}
[Severity: Low]
Should this range-abort walk live behind struct bitmap_operations in
drivers/md/md-bitmap.c instead of raid10.c?
raid10_abort_sync_bitmap() checks mddev->bitmap_id == ID_BITMAP and
hardcodes classic bitmap's hijacked counter-page layout from
md_bitmap_get_counter(), while md-bitmap.c already owns both that layout
and the full-bitmap walk in bitmap_close_sync().
Separately, on aborted recovery raid10_sync_request() still runs the
per-disk raid10_find_virt() and md_bitmap_end_sync() loop right before
raid10_abort_sync_bitmap(mddev, 0) walks and ends every chunk from
sector 0 again.
[ ... ]
> @@ -3182,8 +3229,16 @@ static sector_t raid10_sync_request(struct mddev *mddev, sector_t sector_nr,
> }
> conf->fullsync = 0;
> }
> - if (md_bitmap_enabled(mddev, false))
> + if (aborted && raid10_classic_bitmap(mddev) &&
> + !test_bit(MD_RECOVERY_SYNC, &mddev->recovery)) {
> + /*
> + * close_sync would clear in-progress chunks that
> + * still have copies outstanding.
> + */
> + raid10_abort_sync_bitmap(mddev, 0);
> + } else if (md_bitmap_enabled(mddev, false)) {
> mddev->bitmap_ops->close_sync(mddev);
> + }
> close_sync(conf);
> *skipped = 1;
> return 0;
[Severity: Medium]
Can calling raid10_abort_sync_bitmap(mddev, 0) and skipping close_sync()
permanently leave NEEDED_MASK set on already-recovered chunks?
When recovery resumes, md_sync_position() starts at rdev->recovery_offset,
so chunks whose copies all lie below curr_resync are never revisited by
md_bitmap_start_sync(). When recovery later finishes, bitmap_close_sync()
only clears RESYNC_MASK and leaves NEEDED_MASK set.
Because NEEDED_MASK keeps *bmc above 2, bitmap_daemon_work() never clears
those on-disk bits or lets md_bitmap_checkfree() free their 4 KiB counter
pages. Those pages stay pinned in memory while the array runs, and a
later unclean shutdown or member re-add needlessly resyncs those chunks.
Passing a layout-derived virtual lower bound for curr_resync as start (for
example on near and offset layouts) and then calling close_sync() would
close already-completed chunks cleanly.
--
Sashiko AI review · https://sashiko.dev/#/patchset/20261204174621.3475573-1-ehagberg@janestreet.com?part=2
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH RESEND 2/3] md/raid10: re-arm in-progress bitmap chunks when recovery is interrupted
2026-12-04 18:16 ` sashiko-bot
@ 2026-12-04 19:17 ` Eric Hagberg
0 siblings, 0 replies; 10+ messages in thread
From: Eric Hagberg @ 2026-12-04 19:17 UTC (permalink / raw)
To: sashiko-reviews; +Cc: linux-raid, yukuai, Jason Chu
On Fri, Dec 04, 2026, sashiko-bot wrote:
> [Severity: Medium]
> Can calling raid10_abort_sync_bitmap(mddev, 0) and skipping close_sync()
> permanently leave NEEDED_MASK set on already-recovered chunks?
Yes. After an aborted recovery, a chunk whose copies on the recovering
member all lie below the checkpoint gets NEEDED back, and the resumed
recovery, which starts at the recovery offset, does not visit it again.
The chunk then stays dirty until a later resync, check or repair syncs
it. No data is lost, but the bit and its counter page stay in use, and
those chunks are copied again after a later unclean shutdown or re-add.
The commit message ("copied again later") should say that.
A lower bound derived from curr_resync and the layout would leave most
of those chunks clean. We kept the walk from sector 0 because it is
simple and cannot skip a copy. If you prefer the tighter bound, or the
md-bitmap.c approach from question 1 in the cover letter, we will do
that in v2.
> [Severity: Low]
> Is this rationale (and the matching note in the commit message) accurate
> for aborted recovery?
No, it is imprecise. For an aborted recovery llbitmap_end_sync() is
called with the array offsets that curr_resync maps to, and
llbitmap_close_sync() leaves the syncing chunks below them dirty.
Nothing is skipped because llbitmap syncs dirty chunks again while the
array is degraded. We will fix the comment and the commit message in
v2. llbitmap was not tested.
> [Severity: Low]
> Should this range-abort walk live behind struct bitmap_operations in
> drivers/md/md-bitmap.c instead of raid10.c?
That is question 1 in the cover letter; we would like the maintainers'
view before changing it. The per-slot end_sync() loop before the walk
is indeed redundant for the classic bitmap; v2 can skip it.
Thanks,
Eric
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH RESEND 3/3] md/raid10: keep look-ahead bitmap chunks when resync is interrupted
2026-12-04 18:09 ` sashiko-bot
@ 2026-12-04 19:18 ` Eric Hagberg
0 siblings, 0 replies; 10+ messages in thread
From: Eric Hagberg @ 2026-12-04 19:18 UTC (permalink / raw)
To: sashiko-reviews; +Cc: linux-raid, yukuai, Jason Chu
On Fri, Dec 04, 2026, sashiko-bot wrote:
> [Severity: Low]
> Should this look-ahead abort handling live behind struct bitmap_operations
> in drivers/md/md-bitmap.c instead of extending the raid10-local workaround?
This is question 1 in the cover letter. We kept it in raid10.c because
that is what we tested. If the maintainers prefer an abort-aware close
in md-bitmap.c that takes the abort position, which would also do it in
one pass and could serve raid1, we will rework the series that way.
Thanks,
Eric
^ permalink raw reply [flat|nested] 10+ messages in thread
end of thread, other threads:[~2026-12-04 19:19 UTC | newest]
Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-30 19:31 [REGRESSION] md/raid10: far-layout member left with stale data after bitmap re-add (6.11+, 6.12.y, 6.18.y) Eric Hagberg
2026-11-30 19:48 ` sashiko-bot
2026-12-04 17:46 ` [PATCH RESEND 0/3] md/raid10: fix old data left by skipped and interrupted sync Eric Hagberg
2026-12-04 17:46 ` [PATCH RESEND 1/3] md/raid10: do not skip past the range that sync_request examined Eric Hagberg
2026-12-04 17:46 ` [PATCH RESEND 2/3] md/raid10: re-arm in-progress bitmap chunks when recovery is interrupted Eric Hagberg
2026-12-04 18:16 ` sashiko-bot
2026-12-04 19:17 ` Eric Hagberg
2026-12-04 17:46 ` [PATCH RESEND 3/3] md/raid10: keep look-ahead bitmap chunks when resync " Eric Hagberg
2026-12-04 18:09 ` sashiko-bot
2026-12-04 19:18 ` Eric Hagberg
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox