mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Li Nan <linan666@huaweicloud.com>
To: Li Nan <linan666@huaweicloud.com>, Xiao Ni <xni@redhat.com>
Cc: corbet@lwn.net, song@kernel.org, yukuai3@huawei.com,
	hare@suse.de, linux-doc@vger.kernel.org,
	linux-kernel@vger.kernel.org, linux-raid@vger.kernel.org,
	martin.petersen@oracle.com, yangerkun@huawei.com,
	yi.zhang@huawei.com
Subject: Re: [PATCH v5 2/2] md: allow configuring logical block size
Date: Fri, 26 Sep 2025 15:22:40 +0800	[thread overview]
Message-ID: <4ae18bbf-3301-ac40-b422-629cefdd7b12@huaweicloud.com> (raw)
In-Reply-To: <6b6acb6c-7ad8-ae71-b56a-9129d4bb4bd6@huaweicloud.com>



在 2025/9/25 16:34, Li Nan 写道:
> 
> 
> 在 2025/9/23 22:06, Xiao Ni 写道:
>> On Tue, Sep 23, 2025 at 9:37 PM Li Nan <linan666@huaweicloud.com> wrote:
>>>
>>>
>>>
>>> 在 2025/9/23 19:36, Xiao Ni 写道:
>>>> Hi Li Nan
>>>>
>>>> On Thu, Sep 18, 2025 at 8:08 PM <linan666@huaweicloud.com> wrote:
>>>>>
>>>>> From: Li Nan <linan122@huawei.com>
>>>>>
>>>>> Previously, raid array used the maximum logical block size (LBS)
>>>>> of all member disks. Adding a larger LBS disk at runtime could
>>>>> unexpectedly increase RAID's LBS, risking corruption of existing
>>>>> partitions. This can be reproduced by:

[...]

>>>>> +static ssize_t
>>>>> +lbs_store(struct mddev *mddev, const char *buf, size_t len)
>>>>> +{
>>>>> +       unsigned int lbs;
>>>>> +       int err = -EBUSY;
>>>>> +
>>>>> +       /* Only 1.x meta supports configurable LBS */
>>>>> +       if (mddev->major_version == 0)
>>>>> +               return -EINVAL;
>>>>
>>>> It looks like it should check raid level here as doc mentioned above, 
>>>> right?
>>>
>>> Yeah, kuai suggests supporting this feature only in 1.x meta.
>>
>> I mean it should check if raid is raid0 here, right? As doc mentioned,
>> it should return error if raid is level 0.
>>
>> Regards
>> Xiao
> 
> Apologies — I misunderstood. I will add check in v6.
> 

I found that md_logical_block_size.attr is added to md_redundancy_attrs and
is is only created when pers->sync_request is present. Raid0 will not
create it. So the check is unnecessary.

-- 
Thanks,
Nan


  reply	other threads:[~2025-09-26  7:22 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-09-18 11:57 [PATCH v5 0/2] make logical block size configurable linan666
2025-09-18 11:57 ` [PATCH v5 1/2] md: prevent adding disks with larger logical_block_size to active arrays linan666
2025-09-20  9:55   ` Yu Kuai
2025-09-18 11:57 ` [PATCH v5 2/2] md: allow configuring logical block size linan666
2025-09-23 11:36   ` Xiao Ni
2025-09-23 13:36     ` Li Nan
2025-09-23 14:06       ` Xiao Ni
2025-09-25  8:34         ` Li Nan
2025-09-26  7:22           ` Li Nan [this message]
2025-09-25  8:38         ` Li Nan

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=4ae18bbf-3301-ac40-b422-629cefdd7b12@huaweicloud.com \
    --to=linan666@huaweicloud.com \
    --cc=corbet@lwn.net \
    --cc=hare@suse.de \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-raid@vger.kernel.org \
    --cc=martin.petersen@oracle.com \
    --cc=song@kernel.org \
    --cc=xni@redhat.com \
    --cc=yangerkun@huawei.com \
    --cc=yi.zhang@huawei.com \
    --cc=yukuai3@huawei.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®