linux-raid.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] mdadm: fix --grow with --add for linear
@ 2024-12-27  6:07 Yu Kuai
  2024-12-31  8:49 ` Mariusz Tkaczyk
  0 siblings, 1 reply; 4+ messages in thread
From: Yu Kuai @ 2024-12-27  6:07 UTC (permalink / raw)
  To: mtkaczyk, song; +Cc: linux-raid, yukuai3, yangerkun

From: Yu Kuai <yukuai3@huawei.com>

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>
---
 mdadm.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/mdadm.c b/mdadm.c
index 7d3b656b..1fd4dcba 100644
--- a/mdadm.c
+++ b/mdadm.c
@@ -1625,7 +1625,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.39.2


^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2025-01-27  9:35 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-12-27  6:07 [PATCH] mdadm: fix --grow with --add for linear Yu Kuai
2024-12-31  8:49 ` Mariusz Tkaczyk
2025-01-26  8:22   ` Yu Kuai
2025-01-27  9:35     ` Mariusz Tkaczyk

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).