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

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