dcavalca / rpms / mdadm

Forked from rpms/mdadm 3 years ago
Clone

Blame SOURCES/mdadm-3.2.6-imsm-Forbid-spanning-between-multiple-controllers.patch

373056
From 3c309c82699ae3bebc716dbd5abea079dd41184a Mon Sep 17 00:00:00 2001
373056
From: Marcin Tomczak <marcin.tomczak@intel.com>
373056
Date: Fri, 9 Nov 2012 15:46:36 +0100
373056
Subject: [PATCH] imsm: Forbid spanning between multiple controllers.
373056
373056
Attaching disks to multiple controllers of the same type has been
373056
allowed so far. Now spanning between multiple controllers is disallowed
373056
at all by IMSM metadata.
373056
373056
Signed-off-by: Marcin Tomczak <marcin.tomczak@intel.com>
373056
Reviewed-by: Lukasz Dorau <lukasz.dorau@intel.com>
373056
Signed-off-by: NeilBrown <neilb@suse.de>
373056
---
373056
 super-intel.c | 25 ++++++++-----------------
373056
 1 file changed, 8 insertions(+), 17 deletions(-)
373056
373056
diff --git a/super-intel.c b/super-intel.c
373056
index 202b83f..4ac9d42 100644
373056
--- a/super-intel.c
373056
+++ b/super-intel.c
373056
@@ -558,20 +558,11 @@ static int attach_hba_to_super(struct intel_super *super, struct sys_dev *device
373056
 	if (super->hba == NULL) {
373056
 		super->hba = alloc_intel_hba(device);
373056
 		return 1;
373056
-	}
373056
-
373056
-	hba = super->hba;
373056
-	/* Intel metadata allows for all disks attached to the same type HBA.
373056
-	 * Do not sypport odf HBA types mixing
373056
-	 */
373056
-	if (device->type != hba->type)
373056
+	} else
373056
+		/* IMSM metadata disallows to attach disks to multiple
373056
+		 * controllers.
373056
+		 */
373056
 		return 2;
373056
-
373056
-	while (hba->next)
373056
-		hba = hba->next;
373056
-
373056
-	hba->next = alloc_intel_hba(device);
373056
-	return 1;
373056
 }
373056
 
373056
 static struct sys_dev* find_disk_attached_hba(int fd, const char *devname)
373056
@@ -3073,11 +3064,11 @@ static int compare_super_imsm(struct supertype *st, struct supertype *tst)
373056
 	 */
373056
 	if (!check_env("IMSM_NO_PLATFORM")) {
373056
-		if (!first->hba || !sec->hba ||
373056
-		    (first->hba->type != sec->hba->type))  {
373056
+		if (first->hba && sec->hba &&
373056
+		    strcmp(first->hba->path, sec->hba->path) != 0)  {
373056
 			fprintf(stderr,
373056
 				"HBAs of devices does not match %s != %s\n",
373056
-				first->hba ? get_sys_dev_type(first->hba->type) : NULL,
373056
-				sec->hba ? get_sys_dev_type(sec->hba->type) : NULL);
373056
+				first->hba ? first->hba->path : NULL,
373056
+				sec->hba ? sec->hba->path : NULL);
373056
 			return 3;
373056
 		}
373056
 	}
373056
@@ -3819,7 +3810,7 @@ static int find_intel_hba_capability(int fd, struct intel_super *super, char *de
373056
 			}
373056
 
373056
 			fprintf(stderr, ").\n"
373056
-				"    Mixing devices attached to different controllers "
373056
+				"    Mixing devices attached to multiple controllers "
373056
 				"is not allowed.\n");
373056
 		}
373056
 		free_sys_dev(&hba_name);
373056
-- 
373056
1.7.11.7
373056