From: Adam Kwolek Date: Wed, 7 Dec 2011 12:58:07 +0000 (+0100) Subject: imsm: FIX: Do not allow spare activation during rebuild X-Git-Tag: mdadm-3.2.3~34 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=fc8ca064477b0f018ed46c21d6f39bfefefad761;p=thirdparty%2Fmdadm.git imsm: FIX: Do not allow spare activation during rebuild Do not allow for spare device activation while rebuild is in progress, when additional degradation occur. Signed-off-by: Adam Kwolek Signed-off-by: NeilBrown --- diff --git a/super-intel.c b/super-intel.c index c6509aff..973b22fc 100644 --- a/super-intel.c +++ b/super-intel.c @@ -6784,6 +6784,14 @@ static struct mdinfo *imsm_activate_spare(struct active_array *a, if (imsm_reshape_blocks_arrays_changes(super)) return NULL; + /* Cannot activate another spare if rebuild is in progress already + */ + if (is_rebuilding(dev)) { + dprintf("imsm: No spare activation allowed. " + "Rebuild in progress already.\n"); + return NULL; + } + if (a->info.array.level == 4) /* No repair for takeovered array * imsm doesn't support raid4