]> git.ipfire.org Git - thirdparty/mdadm.git/commitdiff
IMSM: Do not update metadata if not able to migrate
authorPawel Baldysiak <pawel.baldysiak@intel.com>
Thu, 22 Dec 2016 12:10:47 +0000 (13:10 +0100)
committerJes Sorensen <Jes.Sorensen@redhat.com>
Thu, 22 Dec 2016 17:20:13 +0000 (12:20 -0500)
This patch prevents mdadm from updating metadata if migration is
not possible. The same check is done in analyse_change(),
but in that place - metadata is already modified.

Signed-off-by: Pawel Baldysiak <pawel.baldysiak@intel.com>
Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
super-intel.c

index b7a52031d11d61050797831aec97575633dd4255..df95957226ccf43986264cebd0105bc48bad4126 100644 (file)
@@ -10815,6 +10815,11 @@ enum imsm_reshape_type imsm_analyze_change(struct supertype *st,
                        pr_err("Error. Chunk size change for RAID 10 is not supported.\n");
                        change = -1;
                        goto analyse_change_exit;
+               } else if (info.component_size % (geo->chunksize/512)) {
+                       pr_err("New chunk size (%dK) does not evenly divide device size (%lluk). Aborting...\n",
+                              geo->chunksize/1024, info.component_size/2);
+                       change = -1;
+                       goto analyse_change_exit;
                }
                change = CH_MIGRATION;
        } else {