mdadm/0016-mdadm-fix-grow-with-add-for-linear.patch
Xiao Ni e778d07c4c Update to mdadm 4.4
Resolves: RHEL-86676, RHEL-72803, RHEL-88793, RHEL-88791

Signed-off-by: Xiao Ni <xni@redhat.com>
2025-04-30 06:54:31 -04:00

37 lines
1.2 KiB
Diff

From c09ae8417dc9e11da1d5bf2867c6498050c6ddb9 Mon Sep 17 00:00:00 2001
From: Yu Kuai <yukuai3@huawei.com>
Date: Fri, 27 Dec 2024 14:07:02 +0800
Subject: [PATCH 16/37] mdadm: fix --grow with --add for linear
For the case mdadm --grow with --add, the s.btype should not be
initialized yet, hence BitmapUnknown should be checked instead of
BitmapNone.
Noted that this behaviour should only support by md-linear, which is
removed from kernel, howerver, it turns out md-linear is used widely
in home NAS and we're planning to reintroduce it soon.
Fixes: 581ba1341017 ("mdadm: remove bitmap file support")
Signed-off-by: Yu Kuai <yukuai3@huawei.com>
Signed-off-by: Mariusz Tkaczyk <mtkaczyk@kernel.org>
---
mdadm.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/mdadm.c b/mdadm.c
index a72058b4..6200cd0e 100644
--- a/mdadm.c
+++ b/mdadm.c
@@ -1619,7 +1619,7 @@ int main(int argc, char *argv[])
if (devs_found > 1 && s.raiddisks == 0 && s.level == UnSet) {
/* must be '-a'. */
if (s.size > 0 || s.chunk ||
- s.layout_str || s.btype != BitmapNone) {
+ s.layout_str || s.btype != BitmapUnknown) {
pr_err("--add cannot be used with other geometry changes in --grow mode\n");
rv = 1;
break;
--
2.41.0