From fc8ca064477b0f018ed46c21d6f39bfefefad761 Mon Sep 17 00:00:00 2001 From: Adam Kwolek Date: Wed, 7 Dec 2011 13:58:07 +0100 Subject: [PATCH] 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 --- super-intel.c | 8 ++++++++ 1 file changed, 8 insertions(+) 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 -- 2.39.2