Blame SOURCES/0081-incremental-manage-do-not-verify-if-remove-is-safe.patch

37f2b0
From 461fae7e7809670d286cc19aac5bfa861c29f93a Mon Sep 17 00:00:00 2001
37f2b0
From: Kinga Tanska <kinga.tanska@intel.com>
37f2b0
Date: Tue, 27 Dec 2022 06:50:43 +0100
37f2b0
Subject: [PATCH 81/83] incremental, manage: do not verify if remove is safe
37f2b0
37f2b0
Function is_remove_safe() was introduced to verify if removing
37f2b0
member device won't cause failed state of the array. This
37f2b0
verification should be used only with set-faulty command. Add
37f2b0
special mode indicating that Incremental removal was executed.
37f2b0
If this mode is used do not execute is_remove_safe() routine.
37f2b0
37f2b0
Signed-off-by: Kinga Tanska <kinga.tanska@intel.com>
37f2b0
Signed-off-by: Jes Sorensen <jes@trained-monkey.org>
37f2b0
---
37f2b0
 Incremental.c | 2 +-
37f2b0
 Manage.c      | 7 ++++---
37f2b0
 2 files changed, 5 insertions(+), 4 deletions(-)
37f2b0
37f2b0
diff --git a/Incremental.c b/Incremental.c
37f2b0
index ff3548c0..09b94b9f 100644
37f2b0
--- a/Incremental.c
37f2b0
+++ b/Incremental.c
37f2b0
@@ -1744,7 +1744,7 @@ int IncrementalRemove(char *devname, char *id_path, int verbose)
37f2b0
 
37f2b0
 	memset(&devlist, 0, sizeof(devlist));
37f2b0
 	devlist.devname = devname;
37f2b0
-	devlist.disposition = 'f';
37f2b0
+	devlist.disposition = 'I';
37f2b0
 	/* for a container, we must fail each member array */
37f2b0
 	if (ent->metadata_version &&
37f2b0
 	    strncmp(ent->metadata_version, "external:", 9) == 0) {
37f2b0
diff --git a/Manage.c b/Manage.c
37f2b0
index 4d6e54b1..6184d3f7 100644
37f2b0
--- a/Manage.c
37f2b0
+++ b/Manage.c
37f2b0
@@ -1494,8 +1494,9 @@ int Manage_subdevs(char *devname, int fd,
37f2b0
 			/* Assume this is a kernel-internal name like 'sda1' */
37f2b0
 			int found = 0;
37f2b0
 			char dname[55];
37f2b0
-			if (dv->disposition != 'r' && dv->disposition != 'f') {
37f2b0
-				pr_err("%s only meaningful with -r or -f, not -%c\n",
37f2b0
+			if (dv->disposition != 'r' && dv->disposition != 'f' &&
37f2b0
+			    dv->disposition != 'I') {
37f2b0
+				pr_err("%s only meaningful with -r, -f or -I, not -%c\n",
37f2b0
 					dv->devname, dv->disposition);
37f2b0
 				goto abort;
37f2b0
 			}
37f2b0
@@ -1647,7 +1648,7 @@ int Manage_subdevs(char *devname, int fd,
37f2b0
 					close(sysfd);
37f2b0
 				goto abort;
37f2b0
 			}
37f2b0
-
37f2b0
+		case 'I': /* incremental fail */
37f2b0
 			if ((sysfd >= 0 && write(sysfd, "faulty", 6) != 6) ||
37f2b0
 			    (sysfd < 0 && ioctl(fd, SET_DISK_FAULTY,
37f2b0
 						rdev))) {
37f2b0
-- 
37f2b0
2.38.1
37f2b0