From 2a4a08e7d3a3a76094352a3c477d7901ac993554 Mon Sep 17 00:00:00 2001 From: Adam Kwolek Date: Wed, 6 Apr 2011 12:40:04 +1000 Subject: imsm: FIX: Check array alignment before expansion 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 Signed-off-by: NeilBrown --- super-intel.c | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'super-intel.c') diff --git a/super-intel.c b/super-intel.c index 010226db..362e4330 100644 --- a/super-intel.c +++ b/super-intel.c @@ -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 && -- cgit v1.2.3