From: "yu kuai" <yukuai@fygo.io>
To: <incharilla@incharilla.site>, "Song Liu" <song@kernel.org>,
"Li Nan" <magiclinan@didiglobal.com>,
"Xiao Ni" <xiao@kernel.org>, "yu kuai" <yukuai@fygo.io>
Cc: "Yu Kuai" <yukuai@fnnas.com>,
"Corey Hickey" <bugfood-c@fatooh.org>,
<linux-raid@vger.kernel.org>, <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] md: dont warn about sb update on auto read only arrays
Date: Sun, 8 Nov 2026 10:53:33 +0800 [thread overview]
Message-ID: <2bea7aea-774f-443d-8228-e1c68f7d5bd0@fygo.io> (raw)
In-Reply-To: <20261106-md-auto-read-only-sb-warn-v1-1-5bfde3559841@incharilla.site>
在 2026/11/7 2:20, incharilla via B4 Relay 写道:
> From: incharilla<incharilla@incharilla.site>
>
> Commit 8c9e376b9d1a ("md: warn about updating super block failure") added
> an error when md_update_sb is called on a read only array to help debug io
> hangs.
>
> An array that is started auto read only prints this error for no reason.
> This happens when it is assembled with start_ro set or when a degraded
> array is created with start_ro set. md_update_sb already defers the
> update by setting MD_SB_CHANGE_DEVS and the sb is written as soon as the
> first write makes the array read write. No io can hang on an array that
> has not been written to yet.
>
> Skip the message for MD_AUTO_READ the same way dm raid is already skipped.
> It is still printed for arrays that are really read only.
>
> Tested in qemu on loop devices with raid1 and raid5 and raid10. Before
> this patch assembling a clean array with start_ro set prints the error
> for all three levels. Creating a degraded array with start_ro set prints
> it in 5 of 10 tries for raid1 and 8 of 10 for raid5 and 4 of 10 for
> raid10. After this patch none of these print it. On raid1 the first write
> still makes the array read write and the sb events go from 17 to 19.
> Assembling with mdadm --readonly still prints the error.
>
> The fix and the qemu test were made with help from Claude Code.
>
> Fixes: 8c9e376b9d1a ("md: warn about updating super block failure")
> Reported-by: Corey Hickey<bugfood-c@fatooh.org>
> Closes:https://bugzilla.kernel.org/show_bug.cgi?id=222162
> Signed-off-by: incharilla<incharilla@incharilla.site>
> ---
> Found from bugzilla 222162. The qemu test script used is a busybox
> initramfs that creates raid1 and raid5 and raid10 arrays on loop devices
> with start_ro set and counts the message in dmesg.
> ---
> drivers/md/md.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
Applied
--
Thanks,
Kuai
prev parent reply other threads:[~2026-11-08 2:53 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-06 18:20 incharilla via B4 Relay
2026-11-07 23:50 ` Corey Hickey
2026-11-08 2:53 ` yu kuai [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=2bea7aea-774f-443d-8228-e1c68f7d5bd0@fygo.io \
--to=yukuai@fygo.io \
--cc=bugfood-c@fatooh.org \
--cc=incharilla@incharilla.site \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-raid@vger.kernel.org \
--cc=magiclinan@didiglobal.com \
--cc=song@kernel.org \
--cc=xiao@kernel.org \
--cc=yukuai@fnnas.com \
/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
all inboxes | Powered by JetHome®