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

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