Blame SOURCES/Create-Remove-all-attemps-to-handle-md-driver-older-.patch

2c1b57
From 5f4cc2392689528a9234fae1935cd442f7917738 Mon Sep 17 00:00:00 2001
2c1b57
From: Jes Sorensen <Jes.Sorensen@gmail.com>
2c1b57
Date: Wed, 5 Apr 2017 15:32:40 -0400
2c1b57
Subject: [RHEL7.5 PATCH 058/169] Create: Remove all attemps to handle md
2c1b57
 driver older than 0.90.03
2c1b57
2c1b57
More legacy code moved to the bit-bucket.
2c1b57
2c1b57
Signed-off-by: Jes Sorensen <Jes.Sorensen@gmail.com>
2c1b57
---
2c1b57
 Create.c | 30 +++++-------------------------
2c1b57
 1 file changed, 5 insertions(+), 25 deletions(-)
2c1b57
2c1b57
diff --git a/Create.c b/Create.c
2c1b57
index 4f98c58..6ca0924 100644
2c1b57
--- a/Create.c
2c1b57
+++ b/Create.c
2c1b57
@@ -97,7 +97,6 @@ int Create(struct supertype *st, char *mddev,
2c1b57
 	int insert_point = subdevs * 2; /* where to insert a missing drive */
2c1b57
 	int total_slots;
2c1b57
 	int pass;
2c1b57
-	int vers;
2c1b57
 	int rv;
2c1b57
 	int bitmap_fd;
2c1b57
 	int have_container = 0;
2c1b57
@@ -112,6 +111,7 @@ int Create(struct supertype *st, char *mddev,
2c1b57
 	char chosen_name[1024];
2c1b57
 	struct map_ent *map = NULL;
2c1b57
 	unsigned long long newsize;
2c1b57
+	mdu_array_info_t inf;
2c1b57
 
2c1b57
 	int major_num = BITMAP_MAJOR_HI;
2c1b57
 	if (s->bitmap_file && strcmp(s->bitmap_file, "clustered") == 0) {
2c1b57
@@ -150,7 +150,6 @@ int Create(struct supertype *st, char *mddev,
2c1b57
 		/* If given a single device, it might be a container, and we can
2c1b57
 		 * extract a device list from there
2c1b57
 		 */
2c1b57
-		mdu_array_info_t inf;
2c1b57
 		int fd;
2c1b57
 
2c1b57
 		memset(&inf, 0, sizeof(inf));
2c1b57
@@ -625,18 +624,11 @@ int Create(struct supertype *st, char *mddev,
2c1b57
 	}
2c1b57
 	mddev = chosen_name;
2c1b57
 
2c1b57
-	vers = md_get_version(mdfd);
2c1b57
-	if (vers < 9000) {
2c1b57
-		pr_err("Create requires md driver version 0.90.0 or later\n");
2c1b57
+	memset(&inf, 0, sizeof(inf));
2c1b57
+	md_get_array_info(mdfd, &inf);
2c1b57
+	if (inf.working_disks != 0) {
2c1b57
+		pr_err("another array by this name is already running.\n");
2c1b57
 		goto abort_locked;
2c1b57
-	} else {
2c1b57
-		mdu_array_info_t inf;
2c1b57
-		memset(&inf, 0, sizeof(inf));
2c1b57
-		md_get_array_info(mdfd, &inf);
2c1b57
-		if (inf.working_disks != 0) {
2c1b57
-			pr_err("another array by this name is already running.\n");
2c1b57
-			goto abort_locked;
2c1b57
-		}
2c1b57
 	}
2c1b57
 
2c1b57
 	/* Ok, lets try some ioctls */
2c1b57
@@ -761,20 +753,8 @@ int Create(struct supertype *st, char *mddev,
2c1b57
 	 * to stop another mdadm from finding and using those devices.
2c1b57
 	 */
2c1b57
 
2c1b57
-	if (s->bitmap_file && vers < 9003) {
2c1b57
-		major_num = BITMAP_MAJOR_HOSTENDIAN;
2c1b57
-#ifdef __BIG_ENDIAN
2c1b57
-		pr_err("Warning - bitmaps created on this kernel are not portable\n"
2c1b57
-			"  between different architectured.  Consider upgrading the Linux kernel.\n");
2c1b57
-#endif
2c1b57
-	}
2c1b57
-
2c1b57
 	if (s->bitmap_file && (strcmp(s->bitmap_file, "internal") == 0 ||
2c1b57
 			       strcmp(s->bitmap_file, "clustered") == 0)) {
2c1b57
-		if ((vers % 100) < 2) {
2c1b57
-			pr_err("internal bitmaps not supported by this kernel.\n");
2c1b57
-			goto abort_locked;
2c1b57
-		}
2c1b57
 		if (!st->ss->add_internal_bitmap) {
2c1b57
 			pr_err("internal bitmaps not supported with %s metadata\n",
2c1b57
 				st->ss->name);
2c1b57
-- 
2c1b57
2.7.4
2c1b57