]> git.ipfire.org Git - thirdparty/mdadm.git/commitdiff
Grow: set component size prior to array size
authorTomasz Majchrzak <tomasz.majchrzak@intel.com>
Mon, 5 Jun 2017 14:09:44 +0000 (16:09 +0200)
committerJes Sorensen <jsorensen@fb.com>
Mon, 5 Jun 2017 15:06:35 +0000 (11:06 -0400)
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 <tomasz.majchrzak@intel.com>
Signed-off-by: Jes Sorensen <jsorensen@fb.com>
Grow.c

diff --git a/Grow.c b/Grow.c
index ecf5ca0c043ae9e7f0346d8fd79bcfb2b6f3eba3..4ecb1d8449ae1dc1286ab7b08d9c968b82e84453 100644 (file)
--- 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) {