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

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