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

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