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

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