dcavalca / rpms / mdadm

Forked from rpms/mdadm 3 years ago
Clone

Blame SOURCES/0016-imsm-Do-not-block-volume-creation-when-container-has.patch

59ea72
From 59632db96bdd09b44e9927f63a67cccbe8b15cdf Mon Sep 17 00:00:00 2001
59ea72
From: Michal Zylowski <michal.zylowski@intel.com>
59ea72
Date: Tue, 29 May 2018 15:47:09 +0200
59ea72
Subject: [RHEL7.5 PATCH 16/26] imsm: Do not block volume creation when
59ea72
 container has disks with mixed sector size
59ea72
59ea72
Currently when created container keeps disks with mixed sector size (few
59ea72
4K disks and some 512 disks) there is no possibility to create volume from
59ea72
disks with one sector size.
59ea72
Allow volume creation when given disks are related with mixed container.
59ea72
59ea72
Signed-off-by: Michal Zylowski <michal.zylowski@intel.com>
59ea72
Signed-off-by: Jes Sorensen <jsorensen@fb.com>
59ea72
---
59ea72
 super-intel.c | 5 +++++
59ea72
 1 file changed, 5 insertions(+)
59ea72
59ea72
diff --git a/super-intel.c b/super-intel.c
59ea72
index aa93a9e..12f60f6 100644
59ea72
--- a/super-intel.c
59ea72
+++ b/super-intel.c
59ea72
@@ -5616,6 +5616,11 @@ static int add_to_super_imsm_volume(struct supertype *st, mdu_disk_info_t *dk,
59ea72
 		return 1;
59ea72
 	}
59ea72
 
59ea72
+	if (mpb->num_disks == 0)
59ea72
+		if (!get_dev_sector_size(dl->fd, dl->devname,
59ea72
+					 &super->sector_size))
59ea72
+			return 1;
59ea72
+
59ea72
 	if (!drive_validate_sector_size(super, dl)) {
59ea72
 		pr_err("Combining drives of different sector size in one volume is not allowed\n");
59ea72
 		return 1;
59ea72
-- 
59ea72
2.7.4
59ea72