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

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