]> git.ipfire.org Git - thirdparty/mdadm.git/commitdiff
Grow: don't allow to enable PPL when reshape is in progress
authorTomasz Majchrzak <tomasz.majchrzak@intel.com>
Fri, 9 Jun 2017 14:20:19 +0000 (16:20 +0200)
committerJes Sorensen <jsorensen@fb.com>
Fri, 9 Jun 2017 14:58:36 +0000 (10:58 -0400)
Don't allow to enable PPL consistency policy when reshape is in progress.
Current PPL implementation doesn't work when reshape is taking place.

Signed-off-by: Tomasz Majchrzak <tomasz.majchrzak@intel.com>
Signed-off-by: Jes Sorensen <jsorensen@fb.com>
Grow.c

diff --git a/Grow.c b/Grow.c
index f7325cbd6a050b1ab80ec00612d98289fb1535f2..b1cb3069a3145840a901726e6f344a66236f271c 100644 (file)
--- a/Grow.c
+++ b/Grow.c
@@ -530,6 +530,7 @@ int Grow_consistency_policy(char *devname, int fd, struct context *c, struct sha
        char *subarray = NULL;
        int ret = 0;
        char container_dev[PATH_MAX];
+       char buf[20];
 
        if (s->consistency_policy != CONSISTENCY_POLICY_RESYNC &&
            s->consistency_policy != CONSISTENCY_POLICY_PPL) {
@@ -577,6 +578,17 @@ int Grow_consistency_policy(char *devname, int fd, struct context *c, struct sha
                goto free_info;
        }
 
+       if (s->consistency_policy == CONSISTENCY_POLICY_PPL) {
+               if (sysfs_get_str(sra, NULL, "sync_action", buf, 20) <= 0) {
+                       ret = 1;
+                       goto free_info;
+               } else if (strcmp(buf, "reshape\n") == 0) {
+                       pr_err("PPL cannot be enabled when reshape is in progress\n");
+                       ret = 1;
+                       goto free_info;
+               }
+       }
+
        if (subarray) {
                char *update;