From c0dc0ad5f8b9f11c49016467628e9f37b80a0853 Mon Sep 17 00:00:00 2001 From: "Czarnowska, Anna" Date: Thu, 13 Jan 2011 13:22:16 +0000 Subject: fix: segfault if subarray is monitored but container is not In this situation to->parent is null so "to" doesn't change to parent container and to->metadata is still null. This results in segmentation fault when checking to->metadata->ss->external. We should just skip this array as container is needed to move spares to. Signed-off-by: Anna Czarnowska Signed-off-by: NeilBrown --- Monitor.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'Monitor.c') diff --git a/Monitor.c b/Monitor.c index db4e8ccb..596fb6f4 100644 --- a/Monitor.c +++ b/Monitor.c @@ -833,6 +833,11 @@ static void try_spare_migration(struct state *statelist, struct alert_info *info struct state *to = st; unsigned long long min_size; + if (to->parent_dev != NoMdDev && !to->parent) + /* subarray monitored without parent container + * we can't move spares here */ + continue; + if (to->parent) /* member of a container */ to = to->parent; -- cgit v1.2.3