From: Chen Cheng <chenchneg33@gmail.com>
To: Paul Menzel <pmenzel@molgen.mpg.de>, Chen Cheng <chencheng@fnnas.com>
Cc: linux-raid@vger.kernel.org, yukuai@fygo.io, yukuai@fnnas.com,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH] md/raid5: protect batch_head->bm_seq updates
Date: Thu, 18 Jun 2026 20:30:01 +0800 [thread overview]
Message-ID: <9bc752e0-06c0-4960-aac3-0c932bb07298@gmail.com> (raw)
In-Reply-To: <946e31d4-1ea8-4c65-be0a-0f942a9cdf8c@molgen.mpg.de>
在 2026/6/18 20:15, Paul Menzel 写道:
> Dear Chen,
>
>
> Am 18.06.26 um 13:26 schrieb Chen Cheng:
>> 在 2026/6/18 18:36, Paul Menzel 写道:
>
>>> Am 18.06.26 um 08:55 schrieb Chen Cheng:
>>>> From: Chen Cheng <chencheng@fnnas.com>
>>>>
>>>> bm_seq means "stripe delay to flush until bm_seq <= seq_write".
>>>>
>>>> do_release_stripe() keeps STRIPE_BIT_DELAY stripes on bitmap_list
>>>> when bm_seq >= seq_write.
>>>>
>>>> after raid5d() flushes bitmap update and ++seq_write, and
>>>> active_bit_delay() retry to release delayed stripes.
>>>>
>>>> the stripe batch head must carry the newest bm_seq among all
>>>> member stripes, because the whole batch later released according
>>>> to the batch head state and bm_seq.
>>>>
>>>> race scenario:
>>>> ===================
>>>> 1. cpu0 - sh0->bm_seq=101; cpu1 - sh1->bm_seq=102;
>>>> 2. both cpu0 and cpu1 read batch_head->bm_seq = 100;
>>>> 3. cpu1 write 102, and cpu0 overwrite with 101;
>>>>
>>>> the point is, if the head has a lower bm_seq than one of its
>>>> members, the whole batch could be released before that
>>>> member's bitmap is flushed.
>>>> and the on-disk bitmap not record sh1's changes.
>>>
>>> It’s a little hard to read. Could you please improve the wording of the
>>> last paragraph, and maybe also start each sentence with a capital
>>> letter. Maybe also use 75 characters per line.
>>>
>>> Do you have a reproducer by any chance?
>
>> Thanks to review, and , I will follow your advise.
>
> Thank you for reading my comments.
>
>> Actually, I have some reproducer to hit KCSAN reports in RAID-5, but not
>> for this one. Because it's reported by sashiko-review bot, and, I think
>> it's a true risk.
>
> Maybe also mention sashiko-review.
>
>> I will try to make a reproducer for this case later, after I figure-out
>> the other KCSAN reports.
>
> A reproducer is not required, I was just interested, how the issue was
> found. So don’t spend too much on it or at all.
Well , I think a good reproducer has to be :
- Concurrency as much path as possible ,
e.g. reshape concurrency with normal I/O, etc...
Optionally ,
- Run some Sanitizer,
- Inject some fault, e.g. bad block, write error, disk drop...
- Provide some background I/O pressure,
- Do some combinations describes above
>
> […]
>
>
> Kind regards,
>
> Paul
prev parent reply other threads:[~2026-06-18 12:30 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-06-18 6:55 [PATCH] md/raid5: protect batch_head->bm_seq updates Chen Cheng
2026-06-18 10:36 ` Paul Menzel
2026-06-18 11:26 ` Chen Cheng
2026-06-18 12:15 ` Paul Menzel
2026-06-18 12:30 ` Chen Cheng [this message]
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=9bc752e0-06c0-4960-aac3-0c932bb07298@gmail.com \
--to=chenchneg33@gmail.com \
--cc=chencheng@fnnas.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-raid@vger.kernel.org \
--cc=pmenzel@molgen.mpg.de \
--cc=yukuai@fnnas.com \
--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