Blame SOURCES/0068-Fix-update-subarray-on-active-volume.patch

01ff50
From db10eab68e652f141169b7240e057d110d626c3d Mon Sep 17 00:00:00 2001
01ff50
From: Mateusz Kusiak <mateusz.kusiak@intel.com>
01ff50
Date: Mon, 2 Jan 2023 09:35:16 +0100
01ff50
Subject: [PATCH 68/83] Fix --update-subarray on active volume
01ff50
01ff50
Options: bitmap, ppl and name should not be updated when array is active.
01ff50
Those features are mutually exclusive and share the same data area in IMSM (danger of overwriting by kernel).
01ff50
Remove check for active subarrays from super-intel.
01ff50
Since ddf is not supported, apply it globally for all options.
01ff50
01ff50
Signed-off-by: Mateusz Kusiak <mateusz.kusiak@intel.com>
01ff50
Signed-off-by: Jes Sorensen <jes@trained-monkey.org>
01ff50
---
01ff50
 Manage.c      | 7 +++++++
01ff50
 super-intel.c | 5 -----
01ff50
 2 files changed, 7 insertions(+), 5 deletions(-)
01ff50
01ff50
diff --git a/Manage.c b/Manage.c
01ff50
index b1d0e630..5a9ea316 100644
01ff50
--- a/Manage.c
01ff50
+++ b/Manage.c
01ff50
@@ -1745,6 +1745,13 @@ int Update_subarray(char *dev, char *subarray, char *update, struct mddev_ident
01ff50
 		goto free_super;
01ff50
 	}
01ff50
 
01ff50
+	if (is_subarray_active(subarray, st->devnm)) {
01ff50
+		if (verbose >= 0)
01ff50
+			pr_err("Subarray %s in %s is active, cannot update %s\n",
01ff50
+			       subarray, dev, update);
01ff50
+		goto free_super;
01ff50
+	}
01ff50
+
01ff50
 	if (mdmon_running(st->devnm))
01ff50
 		st->update_tail = &st->updates;
01ff50
 
01ff50
diff --git a/super-intel.c b/super-intel.c
01ff50
index b0565610..5f93f3d3 100644
01ff50
--- a/super-intel.c
01ff50
+++ b/super-intel.c
01ff50
@@ -7914,11 +7914,6 @@ static int update_subarray_imsm(struct supertype *st, char *subarray,
01ff50
 		char *ep;
01ff50
 		int vol;
01ff50
 
01ff50
-		if (is_subarray_active(subarray, st->devnm)) {
01ff50
-			pr_err("Unable to update name of active subarray\n");
01ff50
-			return 2;
01ff50
-		}
01ff50
-
01ff50
 		if (!check_name(super, name, 0))
01ff50
 			return 2;
01ff50
 
01ff50
-- 
01ff50
2.38.1
01ff50