]> git.ipfire.org Git - thirdparty/mdadm.git/commitdiff
imsm: Do not block volume creation when container has disks with mixed sector size
authorMichal Zylowski <michal.zylowski@intel.com>
Tue, 29 May 2018 13:47:09 +0000 (15:47 +0200)
committerJes Sorensen <jsorensen@fb.com>
Thu, 31 May 2018 15:29:04 +0000 (11:29 -0400)
Currently when created container keeps disks with mixed sector size (few
4K disks and some 512 disks) there is no possibility to create volume from
disks with one sector size.
Allow volume creation when given disks are related with mixed container.

Signed-off-by: Michal Zylowski <michal.zylowski@intel.com>
Signed-off-by: Jes Sorensen <jsorensen@fb.com>
super-intel.c

index aa93a9e9238f877e5099ee3c4ef3246e0d0ee6ce..12f60f659f131470838b911197d08f9d50c04d74 100644 (file)
@@ -5616,6 +5616,11 @@ static int add_to_super_imsm_volume(struct supertype *st, mdu_disk_info_t *dk,
                return 1;
        }
 
+       if (mpb->num_disks == 0)
+               if (!get_dev_sector_size(dl->fd, dl->devname,
+                                        &super->sector_size))
+                       return 1;
+
        if (!drive_validate_sector_size(super, dl)) {
                pr_err("Combining drives of different sector size in one volume is not allowed\n");
                return 1;