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

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