From: Xiao Ni <xni@redhat.com>
To: linan666@huaweicloud.com
Cc: corbet@lwn.net, song@kernel.org, yukuai3@huawei.com,
linan122@huawei.com, hare@suse.de, martin.petersen@oracle.com,
bvanassche@acm.org, filipe.c.maia@gmail.com,
linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org,
linux-raid@vger.kernel.org, yangerkun@huawei.com,
yi.zhang@huawei.com
Subject: Re: [PATCH v4 1/2] md: prevent adding disks with larger logical_block_size to active arrays
Date: Fri, 12 Sep 2025 11:18:49 +0800 [thread overview]
Message-ID: <CALTww2-rbwtJTm+yyX6mar_eybLCbpFoWQWdOM9j4_hgW0=4Hg@mail.gmail.com> (raw)
In-Reply-To: <20250911073144.42160-2-linan666@huaweicloud.com>
On Thu, Sep 11, 2025 at 3:41 PM <linan666@huaweicloud.com> wrote:
>
> From: Li Nan <linan122@huawei.com>
>
> When adding a disk to a md array, avoid updating the array's
> logical_block_size to match the new disk. This prevents accidental
> partition table loss that renders the array unusable.
>
> The later patch will introduce a way to configure the array's
> logical_block_size.
>
> The issue was introduced before Linux 2.6.12-rc2.
>
> Fixes: d2e45eace8 ("[PATCH] Fix raid "bio too big" failures")
Hi Li Nan
I can't find the commit in
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
git show d2e45eace8
fatal: ambiguous argument 'd2e45eace8': unknown revision or path not
in the working tree.
Use '--' to separate paths from revisions, like this:
'git <command> [<revision>...] -- [<file>...]'
Regards
Xiao
> Signed-off-by: Li Nan <linan122@huawei.com>
> Reviewed-by: Martin K. Petersen <martin.petersen@oracle.com>
> ---
> drivers/md/md.c | 7 +++++++
> 1 file changed, 7 insertions(+)
>
> diff --git a/drivers/md/md.c b/drivers/md/md.c
> index a77c59527d4c..40f56183c744 100644
> --- a/drivers/md/md.c
> +++ b/drivers/md/md.c
> @@ -6064,6 +6064,13 @@ int mddev_stack_new_rdev(struct mddev *mddev, struct md_rdev *rdev)
> if (mddev_is_dm(mddev))
> return 0;
>
> + if (queue_logical_block_size(rdev->bdev->bd_disk->queue) >
> + queue_logical_block_size(mddev->gendisk->queue)) {
> + pr_err("%s: incompatible logical_block_size, can not add\n",
> + mdname(mddev));
> + return -EINVAL;
> + }
> +
> lim = queue_limits_start_update(mddev->gendisk->queue);
> queue_limits_stack_bdev(&lim, rdev->bdev, rdev->data_offset,
> mddev->gendisk->disk_name);
> --
> 2.39.2
>
next prev parent reply other threads:[~2025-09-12 3:19 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-09-11 7:31 [PATCH v4 0/2] make logical_block_size configurable linan666
2025-09-11 7:31 ` [PATCH v4 1/2] md: prevent adding disks with larger logical_block_size to active arrays linan666
2025-09-12 3:18 ` Xiao Ni [this message]
2025-09-12 9:20 ` Li Nan
2025-09-11 7:31 ` [PATCH v4 2/2] md: allow configuring logical_block_size linan666
2025-09-11 8:05 ` Paul Menzel
2025-09-12 9:27 ` Li Nan
2025-09-15 0:33 ` Xiao Ni
2025-09-15 2:15 ` Li Nan
2025-09-15 8:50 ` Xiao Ni
2025-09-16 6:33 ` 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='CALTww2-rbwtJTm+yyX6mar_eybLCbpFoWQWdOM9j4_hgW0=4Hg@mail.gmail.com' \
--to=xni@redhat.com \
--cc=bvanassche@acm.org \
--cc=corbet@lwn.net \
--cc=filipe.c.maia@gmail.com \
--cc=hare@suse.de \
--cc=linan122@huawei.com \
--cc=linan666@huaweicloud.com \
--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=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;
as well as URLs for NNTP newsgroup(s).