diff options
author | Pawel Piatkowski <pawel.piatkowski@intel.com> | 2023-12-20 10:32:49 +0100 |
---|---|---|
committer | Mariusz Tkaczyk <mariusz.tkaczyk@linux.intel.com> | 2024-01-05 11:47:09 +0100 |
commit | 582945c2d3bbead4a71de521a392e292a4a84e24 (patch) | |
tree | de29f4b1f83f0b0efed1154f2e0d364e277c30ad | |
parent | e15e8b00cbce9330e2474fcdb7c3d40d23227555 (diff) | |
download | mdadm-test-582945c2d3bbead4a71de521a392e292a4a84e24.tar.gz |
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")
Signed-off-by: Pawel Piatkowski <pawel.piatkowski@intel.com>
Signed-off-by: Mariusz Tkaczyk <mariusz.tkaczyk@linux.intel.com>
-rw-r--r-- | Manage.c | 3 |
1 files changed, 2 insertions, 1 deletions
@@ -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); |