]> git.ipfire.org Git - thirdparty/mdadm.git/commitdiff
Fix --update-subarray on active volume
authorMateusz Kusiak <mateusz.kusiak@intel.com>
Mon, 2 Jan 2023 08:35:16 +0000 (09:35 +0100)
committerJes Sorensen <jes@trained-monkey.org>
Wed, 4 Jan 2023 15:20:58 +0000 (10:20 -0500)
Options: bitmap, ppl and name should not be updated when array is active.
Those features are mutually exclusive and share the same data area in IMSM (danger of overwriting by kernel).
Remove check for active subarrays from super-intel.
Since ddf is not supported, apply it globally for all options.

Signed-off-by: Mateusz Kusiak <mateusz.kusiak@intel.com>
Signed-off-by: Jes Sorensen <jes@trained-monkey.org>
Manage.c
super-intel.c

index b1d0e630b70707e5739413fd51af45fa6b53a869..5a9ea3165ee3a51cf8afb9cbd48a9d8c78c7e032 100644 (file)
--- a/Manage.c
+++ b/Manage.c
@@ -1745,6 +1745,13 @@ int Update_subarray(char *dev, char *subarray, char *update, struct mddev_ident
                goto free_super;
        }
 
+       if (is_subarray_active(subarray, st->devnm)) {
+               if (verbose >= 0)
+                       pr_err("Subarray %s in %s is active, cannot update %s\n",
+                              subarray, dev, update);
+               goto free_super;
+       }
+
        if (mdmon_running(st->devnm))
                st->update_tail = &st->updates;
 
index b05656105eee32729249f60dcaa31f6b088a7554..5f93f3d30ef1df13daea0a63773784e7a65c9399 100644 (file)
@@ -7914,11 +7914,6 @@ static int update_subarray_imsm(struct supertype *st, char *subarray,
                char *ep;
                int vol;
 
-               if (is_subarray_active(subarray, st->devnm)) {
-                       pr_err("Unable to update name of active subarray\n");
-                       return 2;
-               }
-
                if (!check_name(super, name, 0))
                        return 2;