diff options
author | Czarnowska, Anna <anna.czarnowska@intel.com> | 2011-01-13 13:22:16 +0000 |
---|---|---|
committer | NeilBrown <neilb@suse.de> | 2011-01-17 12:01:11 +1100 |
commit | c0dc0ad5f8b9f11c49016467628e9f37b80a0853 (patch) | |
tree | 4e68e54eae31430acfc0093dd628ca4dde687a51 /Monitor.c | |
parent | a93f87eee607d17024b92dccec9c0eff4dc42565 (diff) |
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 <anna.czarnowska@intel.com>
Signed-off-by: NeilBrown <neilb@suse.de>
Diffstat (limited to 'Monitor.c')
-rw-r--r-- | Monitor.c | 5 |
1 files changed, 5 insertions, 0 deletions
@@ -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; |