]> git.ipfire.org Git - thirdparty/mdadm.git/commitdiff
imsm: FIX: Do not continue reshape when backup exists
authorAdam Kwolek <adam.kwolek@intel.com>
Thu, 9 Jun 2011 03:00:55 +0000 (13:00 +1000)
committerNeilBrown <neilb@suse.de>
Thu, 9 Jun 2011 03:00:55 +0000 (13:00 +1000)
When backup exists in copy area reshape cannot be continued.
In such situation, array is in unstable state.

Signed-off-by: Adam Kwolek <adam.kwolek@intel.com>
Signed-off-by: NeilBrown <neilb@suse.de>
super-intel.c

index ff029d4fb5b603331803ecfe3bfcf474be91e360..06831c3e08a0a0835f5b103156fc946c359f6737 100644 (file)
@@ -8744,6 +8744,13 @@ static int imsm_manage_reshape(
        /* initialize migration record for start condition */
        if (sra->reshape_progress == 0)
                init_migr_record_imsm(st, dev, sra);
+       else {
+               if (__le32_to_cpu(migr_rec->rec_status) != UNIT_SRC_NORMAL) {
+                       dprintf("imsm: cannot restart migration when data "
+                               "are present in copy area.\n");
+                       goto abort;
+               }
+       }
 
        /* size for data */
        buf_size = __le32_to_cpu(migr_rec->blocks_per_unit) * 512;