dcavalca / rpms / mdadm

Forked from rpms/mdadm 3 years ago
Clone

Blame SOURCES/0058-Manage-Remove-the-legacy-code-for-md-driver-prior-to.patch

2910d5
From 1cc3965d48deb0fb3e0657159c608ffb124643c1 Mon Sep 17 00:00:00 2001
2910d5
From: Xiao Yang <ice_yangxiao@163.com>
2910d5
Date: Wed, 27 Nov 2019 11:59:24 +0800
2910d5
Subject: [RHEL8.2 PATCH 48/61] Manage: Remove the legacy code for md driver
2910d5
 prior to 0.90.03
2910d5
2910d5
Previous re-add operation only calls ioctl(HOT_ADD_DISK) for array without
2910d5
metadata(e.g. mdadm -B/--build) when md driver is less than 0.90.02, but
2910d5
commit 091e8e6 breaks the logic and current re-add operation can call
2910d5
ioctl(HOT_ADD_DISK) even if md driver is 0.90.03.
2910d5
2910d5
This issue is reproduced by 05r1-re-add-nosuper:
2910d5
------------------------------------------------
2910d5
++ die 'resync or recovery is happening!'
2910d5
++ echo -e '\n\tERROR: resync or recovery is happening! \n'
2910d5
ERROR: resync or recovery is happening!
2910d5
------------------------------------------------
2910d5
2910d5
Fixes: 091e8e6("Manage: Remove all references to md_get_version()")
2910d5
Reported-by: kernel test robot <lkp@intel.com>
2910d5
Signed-off-by: Xiao Yang <ice_yangxiao@163.com>
2910d5
Signed-off-by: Jes Sorensen <jsorensen@fb.com>
2910d5
---
2910d5
 Manage.c | 12 ------------
2910d5
 1 file changed, 12 deletions(-)
2910d5
2910d5
diff --git a/Manage.c b/Manage.c
2910d5
index 21536f5..ffe55f8 100644
2910d5
--- a/Manage.c
2910d5
+++ b/Manage.c
2910d5
@@ -741,18 +741,6 @@ int Manage_add(int fd, int tfd, struct mddev_dev *dv,
2910d5
 		       "       Adding anyway as --force was given.\n",
2910d5
 		       dv->devname, devname);
2910d5
 	}
2910d5
-	if (!tst->ss->external && array->major_version == 0) {
2910d5
-		if (ioctl(fd, HOT_ADD_DISK, rdev)==0) {
2910d5
-			if (verbose >= 0)
2910d5
-				pr_err("hot added %s\n",
2910d5
-				       dv->devname);
2910d5
-			return 1;
2910d5
-		}
2910d5
-
2910d5
-		pr_err("hot add failed for %s: %s\n",
2910d5
-		       dv->devname, strerror(errno));
2910d5
-		return -1;
2910d5
-	}
2910d5
 
2910d5
 	if (array->not_persistent == 0 || tst->ss->external) {
2910d5
 
2910d5
-- 
2910d5
2.7.5
2910d5