dm raid: also reject size change during recovery
authorHeinz Mauelshagen <heinzm@redhat.com>
Thu, 23 Jun 2016 23:36:06 +0000 (01:36 +0200)
committerMike Snitzer <snitzer@redhat.com>
Mon, 18 Jul 2016 19:37:26 +0000 (15:37 -0400)
Signed-off-by: Heinz Mauelshagen <heinzm@redhat.com>
Signed-off-by: Mike Snitzer <snitzer@redhat.com>
drivers/md/dm-raid.c

index 5e41bf34eb872b2abe136ca943010482933c7ce2..7a33af9cb78b2f2ed0c13e40157fbbe6d2f97e59 100644 (file)
@@ -2772,10 +2772,10 @@ static int raid_ctr(struct dm_target *ti, unsigned argc, char **argv)
                        return -EINVAL;
                }
                rs_setup_recovery(rs, 0);
-       } else if (rs_is_reshaping(rs)) {
-               /* Have to reject size change request during reshape */
+       } else if (rs_is_recovering(rs) || rs_is_reshaping(rs)) {
+               /* Have to reject size change request during recovery/reshape */
                if (calculated_dev_sectors != rs->dev[0].rdev.sectors) {
-                       ti->error = "Can't resize a reshaping raid set";
+                       ti->error = "Can't resize a recovering/reshaping raid set";
                        return -EPERM;
                }
                /* skip setup rs */