Linux RAID subsystem development
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Eric Hagberg" <ehagberg@janestreet.com>
Cc: linux-raid@vger.kernel.org, yukuai@fygo.io
Subject: Re: [PATCH RESEND 3/3] md/raid10: keep look-ahead bitmap chunks when resync is interrupted
Date: Fri, 04 Dec 2026 18:09:19 +0000	[thread overview]
Message-ID: <sashiko-outbox-250383@kernel.org> (raw)
In-Reply-To: <20261204174621.3475573-4-ehagberg@janestreet.com>

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

  reply	other threads:[~2026-12-04 18:09 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 [this message]
2026-12-04 19:18       ` Eric Hagberg

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=sashiko-outbox-250383@kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=ehagberg@janestreet.com \
    --cc=linux-raid@vger.kernel.org \
    --cc=sashiko-reviews@lists.linux.dev \
    --cc=yukuai@fygo.io \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox