lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CALTww28y7D32SAeoGgv2HjFJW471AtTD-SG0yxed4ZCJSOCHUw@mail.gmail.com>
Date: Mon, 15 Sep 2025 16:50:45 +0800
From: Xiao Ni <xni@...hat.com>
To: Li Nan <linan666@...weicloud.com>
Cc: corbet@....net, song@...nel.org, yukuai3@...wei.com, hare@...e.de, 
	martin.petersen@...cle.com, bvanassche@....org, filipe.c.maia@...il.com, 
	linux-doc@...r.kernel.org, linux-kernel@...r.kernel.org, 
	linux-raid@...r.kernel.org, yangerkun@...wei.com, yi.zhang@...wei.com
Subject: Re: [PATCH v4 2/2] md: allow configuring logical_block_size

On Mon, Sep 15, 2025 at 10:15 AM Li Nan <linan666@...weicloud.com> wrote:
>
>
>
> 在 2025/9/15 8:33, Xiao Ni 写道:
> > Hi Nan
> >
> > On Thu, Sep 11, 2025 at 3:41 PM <linan666@...weicloud.com> wrote:
> >>
> >> From: Li Nan <linan122@...wei.com>
> >>
> >> Previously, raid array used the maximum logical_block_size (LBS) of
> >> all member disks. Adding a larger LBS during disk at runtime could
> >> unexpectedly increase RAID's LBS, risking corruption of existing
> >> partitions.
> >
> > Could you describe more about the problem? It's better to give some
> > test steps that can be used to reproduce this problem.
>
> Thanks for your review. I will add reproducer in the next version.

Thanks.
>
> >>
> >> Simply restricting larger-LBS disks is inflexible. In some scenarios,
> >> only disks with 512 LBS are available currently, but later, disks with
> >> 4k LBS may be added to the array.
> >>
> >> Making LBS configurable is the best way to solve this scenario.
> >> After this patch, the raid will:
> >>    - stores LBS in disk metadata.
> >>    - add a read-write sysfs 'mdX/logical_block_size'.
> >>
> >> Future mdadm should support setting LBS via metadata field during RAID
> >> creation and the new sysfs. Though the kernel allows runtime LBS changes,
> >> users should avoid modifying it after creating partitions or filesystems
> >> to prevent compatibility issues.
> >
> > Because it only allows setting when creating an array. Can this be
> > done automatically in kernel space?
> >
> > Best Regards
> > Xiao
>
> The kernel defaults LBS to the max among all rdevs. When creating RAID
> with mdadm, if mdadm doesn't set LBS explicitly, how does the kernel
> learn the intended value?
>
> Gunaghao previously submitted a patch related to mdadm:
> https://lore.kernel.org/all/3a9fa346-1041-400d-b954-2119c1ea001c@huawei.com/

Thanks for reminding me about this patch. First I still need to
understand the problem. It may be a difficult thing for a user to
choose the logcial block size. They don't know why they need to
consider this value, right? If we only need a default value, the
kernel space should be the right place?

Regards
Xiao
>
> --
> Thanks,
> Nan
>


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ