Re: [PATCH v3 2/2] md: Fix forward incompatibility from configurable logical block size
From: Yu Kuai
Date: Fri Dec 26 2025 - 21:17:32 EST
在 2025/12/26 10:42, linan666@xxxxxxxxxxxxxxx 写道:
> From: Li Nan<linan122@xxxxxxxxxx>
>
> Commit 62ed1b582246 ("md: allow configuring logical block size") used
> reserved pad to add 'logical_block_size' to metadata. RAID rejects
> non-zero reserved pad, so arrays fail when rolling back to old kernels
> after booting new ones.
>
> Set 'logical_block_size' only for newly created arrays to support rollback
> to old kernels. Importantly new arrays still won't work on old kernels to
> prevent data loss issue from LBS changes.
>
> For arrays created on old kernels which confirmed not to rollback,
> configure LBS by echo current LBS (queue/logical_block_size) to
> md/logical_block_size.
>
> Fixes: 62ed1b582246 ("md: allow configuring logical block size")
> Reported-by: BugReports<bugreports61@xxxxxxxxx>
> Closes:https://lore.kernel.org/linux-raid/825e532d-d1e1-44bb-5581-692b7c091796@xxxxxxxxxxxxxxx/T/#t
> Signed-off-by: Li Nan<linan122@xxxxxxxxxx>
> ---
> v3:
> - fix comment: %s/writing 'enable'/writing current LBS/
>
> v2:
> - move warn message to mddev_stack_rdev_limits
> - set current LBS to sysfs to enable feature instead of 'enable'
>
> drivers/md/md.c | 48 ++++++++++++++++++++++++++++++++++++++++++++----
> 1 file changed, 44 insertions(+), 4 deletions(-)
Applied to md-6.19 with a few wording changes:
| Location | Before | After |
|---------------------|-----------------------------------|--------------------------------------------|
| Line 5994 (comment) | configured in old kernels array | configured for arrays from old kernels |
| Line 6005 (pr_info) | config logical block size success | logical block size configured successfully |
| Line 6192 (comment) | new array | new arrays |
| Line 6197 (pr_info) | configurable lbs support | configurable LBS support |
| Line 6203 (pr_warn) | data loss issue | data loss issues |
--
Thansk,
Kuai