Thread (2 messages) 2 messages, 2 authors, 2011-01-17

[PATCH] fix: segfault if subarray is monitored but container is not

flat view
STALE5746d

From: Czarnowska, Anna <hidden>
Date: 2011-01-13 13:22:16
Subsystem: the rest · Maintainer: Linus Torvalds

From 7ea892adec6d2f383059b2a337db766735d7217f Mon Sep 17 00:00:00 2001
From: Anna Czarnowska <redacted>
Date: Thu, 13 Jan 2011 14:14:57 +0100
Subject: [PATCH] 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 <redacted>
---
 Monitor.c |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)
diff --git a/Monitor.c b/Monitor.c
index db4e8cc..ab1ae26 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;
-- 
1.7.1
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help