]> git.ipfire.org Git - thirdparty/mdadm.git/commitdiff
imsm: FIX: Check array alignment before expansion
authorAdam Kwolek <adam.kwolek@intel.com>
Wed, 6 Apr 2011 02:40:04 +0000 (12:40 +1000)
committerNeilBrown <neilb@suse.de>
Wed, 6 Apr 2011 02:40:04 +0000 (12:40 +1000)
It can occur that OROM creates array not aligned properly.
Expansion cannot be run in such cases. It is detected in analyse_change().
It is too late. This causes that metadata is in migration state already,
when expansion cannot be started.
This problem has to be detected before metadata is updated,
in all arrays in reshaped container.

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

index 010226db9abbffb5cd0682e929cef78aa0e621cc..362e433021ad9114f387e8ab1efa1bdb4cd80536 100644 (file)
@@ -6946,6 +6946,14 @@ static int imsm_reshape_is_allowed_on_container(struct supertype *st,
                                         geo->raid_disks > 1 ? "s" : "");
                                break;
                        }
+                       /* check if component size is aligned to chunk size
+                        */
+                       if (info->component_size %
+                           (info->array.chunk_size/512)) {
+                               dprintf("Component size is not aligned to "
+                                       "chunk size\n");
+                               break;
+                       }
                }
 
                if (*old_raid_disks &&