From: Tomasz Majchrzak Date: Mon, 5 Jun 2017 14:09:44 +0000 (+0200) Subject: Grow: set component size prior to array size X-Git-Tag: mdadm-4.1-rc1~115 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=07c45a1871df0a70beb8da80d11601d33c7a5de2;p=thirdparty%2Fmdadm.git Grow: set component size prior to array size It is a partial revert of commit 758b327cf5a7 ("Grow: Remove unnecessary optimization"). For native metadata component size is set in kernel for entire disk space. As external metadata supports multiple arrays within one disk, the component size is set to array size. If component size is not updated prior to array size update, the grow operation fails. Signed-off-by: Tomasz Majchrzak Signed-off-by: Jes Sorensen --- diff --git a/Grow.c b/Grow.c index ecf5ca0c..4ecb1d84 100644 --- a/Grow.c +++ b/Grow.c @@ -1977,6 +1977,8 @@ int Grow_reshape(char *devname, int fd, */ min_csize = 0; for (mdi = sra->devs; mdi; mdi = mdi->next) { + sysfs_set_num(sra, mdi, "size", s->size == MAX_SIZE ? 0 + : s->size); if (array.not_persistent == 0 && array.major_version == 0 && get_linux_version() < 3001000) {