]> git.ipfire.org Git - thirdparty/mdadm.git/commitdiff
imsm: block chunk size change for RAID 10
authorMariusz Dabrowski <mariusz.dabrowski@intel.com>
Wed, 12 Oct 2016 12:28:42 +0000 (14:28 +0200)
committerJes Sorensen <Jes.Sorensen@redhat.com>
Wed, 19 Oct 2016 15:22:36 +0000 (11:22 -0400)
Chunk size change of RAID 10 array fails because it is not supported but
invalid values still are being written to metadata and array cannot be
assembled after stop. Operation should be blocked before metadata update.

Signed-off-by: Mariusz Dabrowski <mariusz.dabrowski@intel.com>
Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
super-intel.c

index e1124ba5e587343826b44afccff7640f20c52e95..5cd320ed4fdf739a2822728ce874c982b495c676 100644 (file)
@@ -10087,10 +10087,16 @@ enum imsm_reshape_type imsm_analyze_change(struct supertype *st,
        }
 
        if ((geo->chunksize > 0) && (geo->chunksize != UnSet)
-           && (geo->chunksize != info.array.chunk_size))
+           && (geo->chunksize != info.array.chunk_size)) {
+               if (info.array.level == 10) {
+                       pr_err("Error. Chunk size change for RAID 10 is not supported.\n");
+                       change = -1;
+                       goto analyse_change_exit;
+               }
                change = CH_MIGRATION;
-       else
+       } else {
                geo->chunksize = info.array.chunk_size;
+       }
 
        chunk = geo->chunksize / 1024;