Skip to contentSkip to conversation

Adjust checking subarray state

PATCH Applied Pawel Piatkowski 2 participants 3 messages Dec 20, 2023 – Jan 5, 2024 MD RAID

lore
Share & tools
lore
#0 lore raw

cover Adjust checking subarray state

Pawel Piatkowski (1):
manage: adjust checking subarray state in update_subarray

 Manage.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
Signature · 1 line
2.39.1
#1 lore raw

PATCH 1/1 manage: adjust checking subarray state in update_subarray

Only changing bitmap related consistency_policy requires subarray to be inactive.
consistency_policy with PPL or NO_PPL value can be changed on active subarray.
It fixes regression introduced in commit db10eab68e652f141169 ("Fix --update-subarray on active volume")

---
 Manage.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
Manage.c +2 -1
index f0d4cb01..91532266 100644
@@ -1749,6 +1749,7 @@ int Update_subarray(char *dev, char *subarray, enum update_opt update,
 	int fd, rv = 2;
 	struct mdinfo *info = NULL;
 	char *update_verb = map_num(update_options, update);
+	bool allow_active = update == UOPT_PPL || update == UOPT_NO_PPL;
 
 	memset(st, 0, sizeof(*st));
 
@@ -1763,7 +1764,7 @@ int Update_subarray(char *dev, char *subarray, enum update_opt update,
 		goto free_super;
 	}
 
-	if (is_subarray_active(subarray, st->devnm)) {
+	if (!allow_active && is_subarray_active(subarray, st->devnm)) {
 		if (verbose >= 0)
 			pr_err("Subarray %s in %s is active, cannot update %s\n",
 				subarray, dev, update_verb);
Signature · 1 line
2.39.1
#2 lore raw

Re: [PATCH 1/1] manage: adjust checking subarray state in update_subarray

Quoted 8 lines · On Wed, 20 Dec 2023 10:32:49 +0100 Pawel Piatkowski…

Only changing bitmap related consistency_policy requires subarray to be inactive.
consistency_policy with PPL or NO_PPL value can be changed on active subarray.
It fixes regression introduced in commit db10eab68e652f141169 ("Fix --update-subarray on active volume")

Applied!

Thanks,
Mariusz