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

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