[PATCH 1/3] mdadm/grow: Component size must be larger than chunk size

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Grow: Changing component size must be larger than current
chunk size against stripe raids, otherwise Grow_reshape()
would set s->size to '0'.

Signed-off-by: Zhilong Liu <zlliu@xxxxxxxx>
---
 Grow.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/Grow.c b/Grow.c
index 534ba80..f0a21ff 100644
--- a/Grow.c
+++ b/Grow.c
@@ -1816,6 +1816,12 @@ int Grow_reshape(char *devname, int fd,
 		return 1;
 	}
 
+	if (array.level > 1 &&
+	   (array.chunk_size / 1024) > (int)s->size) {
+		pr_err("component size must be larger than chunk size.\n");
+		return 1;
+	}
+
 	st = super_by_fd(fd, &subarray);
 	if (!st) {
 		pr_err("Unable to determine metadata format for %s\n", devname);
-- 
2.6.6

--
To unsubscribe from this list: send the line "unsubscribe linux-raid" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux RAID Wiki]     [ATA RAID]     [Linux SCSI Target Infrastructure]     [Linux Block]     [Linux IDE]     [Linux SCSI]     [Linux Hams]     [Device Mapper]     [Device Mapper Cryptographics]     [Kernel]     [Linux Admin]     [Linux Net]     [GFS]     [RPM]     [git]     [Yosemite Forum]


  Powered by Linux