From: Su Yue <l@damenly.org>
To: Li Nan <linan666@huaweicloud.com>
Cc: Su Yue <glass.su@suse.com>,
linux-raid@vger.kernel.org, song@kernel.org, xni@redhat.com,
yukuai@fnnas.com, heming.zhao@suse.com
Subject: Re: [PATCH v2 4/5] md: skip ID_BITMAP_NONE when show available bitmap types
Date: Mon, 13 Apr 2026 18:23:03 +0800 [thread overview]
Message-ID: <tstf88hk.fsf@damenly.org> (raw)
In-Reply-To: <4be300df-3943-acf3-ace1-cf6316f2c936@huaweicloud.com> (Li Nan's message of "Mon, 13 Apr 2026 16:15:05 +0800")
On Mon 13 Apr 2026 at 16:15, Li Nan <linan666@huaweicloud.com>
wrote:
> 在 2026/4/7 18:26, Su Yue 写道:
>> As none_bitmap_ops is introduced, ID_BITMAP_NONE should be
>> skipped while
>> iterating md submodules, otherwise:
>> $ cat /sys/block/md0/md/bitmap_type
>> [none] bitmap llbitmap [none]
>> Signed-off-by: Su Yue <glass.su@suse.com>
>> ---
>> drivers/md/md.c | 2 ++
>> 1 file changed, 2 insertions(+)
>> diff --git a/drivers/md/md.c b/drivers/md/md.c
>> index 55a95b227b83..20a953676319 100644
>> --- a/drivers/md/md.c
>> +++ b/drivers/md/md.c
>> @@ -4269,6 +4269,8 @@ bitmap_type_show(struct mddev *mddev,
>> char *page)
>> xa_for_each(&md_submodule, i, head) {
>> if (head->type != MD_BITMAP)
>> continue;
>> + if (head->id == ID_BITMAP_NONE)
>> + continue;
>> if (mddev->bitmap_id == head->id)
>> len += sprintf(page + len, "[%s] ", head->name);
>
> If we indeed add ID_BITMAP_NONE as patch 3, would it be better
> to delete
> this piece of code instead?
>
I dont' think so. There is one case CONFIG_MD_BITMAP is not
enabled which
means register_md_submodule(&none_bitmap_ops.head) is not called
but in
mddev_init():
int mddev_init(struct mddev *mddev)
|
{
|
int err = 0;
|
|
if (!IS_ENABLED(CONFIG_MD_BITMAP))
|
mddev->bitmap_id = ID_BITMAP_NONE;
...
}
--
Su
>
> if (mddev->bitmap_id == ID_BITMAP_NONE)
> len += sprintf(page + len, "[none] ");
> else
> len += sprintf(page + len, "none ");
next prev parent reply other threads:[~2026-04-13 10:28 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-04-07 10:26 [PATCH v2 0/5] md: bitmap grow fixes Su Yue
2026-04-07 10:26 ` [PATCH v2 1/5] md/md-bitmap: call md_bitmap_create,destroy in location_store Su Yue
2026-04-13 7:47 ` Li Nan
2026-04-13 10:18 ` Su Yue
2026-04-15 10:34 ` Xiao Ni
2026-04-07 10:26 ` [PATCH v2 2/5] md/md-bitmap: add an extra sysfs argument to md_bitmap_create and destroy Su Yue
2026-04-07 10:26 ` [PATCH v2 3/5] md/md-bitmap: add dummy bitmap ops for none to fix wrong bitmap offset Su Yue
2026-04-07 10:26 ` [PATCH v2 4/5] md: skip ID_BITMAP_NONE when show available bitmap types Su Yue
2026-04-13 8:15 ` Li Nan
2026-04-13 10:23 ` Su Yue [this message]
2026-04-07 10:26 ` [PATCH v2 5/5] md/md-bitmap: remove member group from bitmap_operations Su Yue
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=tstf88hk.fsf@damenly.org \
--to=l@damenly.org \
--cc=glass.su@suse.com \
--cc=heming.zhao@suse.com \
--cc=linan666@huaweicloud.com \
--cc=linux-raid@vger.kernel.org \
--cc=song@kernel.org \
--cc=xni@redhat.com \
--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