Blame SOURCES/0003-Grow_reshape-Add-r0-grow-size-error-message-and-upda.patch

47b414
From fea026b4849182fc8413014c81456e7215af28d9 Mon Sep 17 00:00:00 2001
47b414
From: Mateusz Kusiak <mateusz.kusiak@intel.com>
47b414
Date: Wed, 23 Mar 2022 15:05:19 +0100
47b414
Subject: [PATCH 03/12] Grow_reshape: Add r0 grow size error message and update
47b414
 man
47b414
47b414
Grow size on r0 is not supported for imsm and native metadata.
47b414
Add proper error message.
47b414
Update man for proper use of --size.
47b414
Signed-off-by: Mateusz Kusiak <mateusz.kusiak@intel.com>
47b414
Signed-off-by: Jes Sorensen <jsorensen@fb.com>
47b414
---
47b414
 Grow.c     |  6 ++++++
47b414
 mdadm.8.in | 19 ++++++++++++-------
47b414
 2 files changed, 18 insertions(+), 7 deletions(-)
47b414
47b414
diff --git a/Grow.c b/Grow.c
47b414
index 9a947204..aa72490b 100644
47b414
--- a/Grow.c
47b414
+++ b/Grow.c
47b414
@@ -1998,6 +1998,12 @@ int Grow_reshape(char *devname, int fd,
47b414
 			goto release;
47b414
 		}
47b414
 
47b414
+		if (array.level == 0) {
47b414
+			pr_err("Component size change is not supported for RAID0\n");
47b414
+			rv = 1;
47b414
+			goto release;
47b414
+		}
47b414
+
47b414
 		if (reshape_super(st, s->size, UnSet, UnSet, 0, 0, UnSet, NULL,
47b414
 				  devname, APPLY_METADATA_CHANGES,
47b414
 				  c->verbose > 0)) {
47b414
diff --git a/mdadm.8.in b/mdadm.8.in
47b414
index be902dba..e2a42425 100644
47b414
--- a/mdadm.8.in
47b414
+++ b/mdadm.8.in
47b414
@@ -459,7 +459,8 @@ number of spare devices.
47b414
 
47b414
 .TP
47b414
 .BR \-z ", " \-\-size=
47b414
-Amount (in Kilobytes) of space to use from each drive in RAID levels 1/4/5/6.
47b414
+Amount (in Kilobytes) of space to use from each drive in RAID levels 1/4/5/6/10
47b414
+and for RAID 0 on external metadata.
47b414
 This must be a multiple of the chunk size, and must leave about 128Kb
47b414
 of space at the end of the drive for the RAID superblock.
47b414
 If this is not specified
47b414
@@ -478,10 +479,19 @@ To guard against this it can be useful to set the initial size
47b414
 slightly smaller than the smaller device with the aim that it will
47b414
 still be larger than any replacement.
47b414
 
47b414
+This option can be used with
47b414
+.B \-\-create
47b414
+for determining initial size of an array. For external metadata,
47b414
+it can be used on a volume, but not on a container itself.
47b414
+Setting initial size of
47b414
+.B RAID 0
47b414
+array is only valid for external metadata.
47b414
+
47b414
 This value can be set with
47b414
 .B \-\-grow
47b414
-for RAID level 1/4/5/6 though
47b414
+for RAID level 1/4/5/6/10 though
47b414
 DDF arrays may not be able to support this.
47b414
+RAID 0 array size cannot be changed.
47b414
 If the array was created with a size smaller than the currently
47b414
 active drives, the extra space can be accessed using
47b414
 .BR \-\-grow .
47b414
@@ -501,11 +511,6 @@ problems the array can be made bigger again with no loss with another
47b414
 .B "\-\-grow \-\-size="
47b414
 command.
47b414
 
47b414
-This value cannot be used when creating a
47b414
-.B CONTAINER
47b414
-such as with DDF and IMSM metadata, though it perfectly valid when
47b414
-creating an array inside a container.
47b414
-
47b414
 .TP
47b414
 .BR \-Z ", " \-\-array\-size=
47b414
 This is only meaningful with
47b414
-- 
47b414
2.31.1
47b414