linux-raid.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/1] Adjust checking subarray state
@ 2023-12-20  9:32 Pawel Piatkowski
  2023-12-20  9:32 ` [PATCH 1/1] manage: adjust checking subarray state in update_subarray Pawel Piatkowski
  0 siblings, 1 reply; 3+ messages in thread
From: Pawel Piatkowski @ 2023-12-20  9:32 UTC (permalink / raw)
  To: linux-raid; +Cc: jes, colyli, mariusz.tkaczyk

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

 Manage.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

-- 
2.39.1


^ permalink raw reply	[flat|nested] 3+ messages in thread

* [PATCH 1/1] manage: adjust checking subarray state in update_subarray
  2023-12-20  9:32 [PATCH 0/1] Adjust checking subarray state Pawel Piatkowski
@ 2023-12-20  9:32 ` Pawel Piatkowski
  2024-01-05 10:48   ` Mariusz Tkaczyk
  0 siblings, 1 reply; 3+ messages in thread
From: Pawel Piatkowski @ 2023-12-20  9:32 UTC (permalink / raw)
  To: linux-raid; +Cc: jes, colyli, mariusz.tkaczyk

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")

Signed-off-by: Pawel Piatkowski <pawel.piatkowski@intel.com>
---
 Manage.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/Manage.c b/Manage.c
index f0d4cb01..91532266 100644
--- a/Manage.c
+++ b/Manage.c
@@ -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);
-- 
2.39.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH 1/1] manage: adjust checking subarray state in update_subarray
  2023-12-20  9:32 ` [PATCH 1/1] manage: adjust checking subarray state in update_subarray Pawel Piatkowski
@ 2024-01-05 10:48   ` Mariusz Tkaczyk
  0 siblings, 0 replies; 3+ messages in thread
From: Mariusz Tkaczyk @ 2024-01-05 10:48 UTC (permalink / raw)
  To: Pawel Piatkowski; +Cc: linux-raid, jes, colyli

On Wed, 20 Dec 2023 10:32:49 +0100
Pawel Piatkowski <pawel.piatkowski@intel.com> wrote:

> 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")
> 
> Signed-off-by: Pawel Piatkowski <pawel.piatkowski@intel.com>

Applied! 

Thanks,
Mariusz

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2024-01-05 10:48 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-12-20  9:32 [PATCH 0/1] Adjust checking subarray state Pawel Piatkowski
2023-12-20  9:32 ` [PATCH 1/1] manage: adjust checking subarray state in update_subarray Pawel Piatkowski
2024-01-05 10:48   ` Mariusz Tkaczyk

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).