Thread (16 messages) 16 messages, 2 authors, 2011-03-09

[PATCH 1/9] FIX: Do not configure and start, already started reshape

flat view
STALE5692d

From: Adam Kwolek <hidden>
Date: 2011-03-02 13:29:04
Subsystem: the rest · Maintainer: Linus Torvalds

When Grow_continue() calls reshape_array(), reshape is configured
and it is started with array. We cannot start reshape again,
when reshape is in progress.
/it in fact waits due to array_state == 'readonly'/

Signed-off-by: Adam Kwolek <redacted>
---

 Grow.c |   12 +++++++++---
 1 files changed, 9 insertions(+), 3 deletions(-)
diff --git a/Grow.c b/Grow.c
index e321a39..d25b71d 100644
--- a/Grow.c
+++ b/Grow.c
@@ -1641,6 +1641,7 @@ static int reshape_array(char *container, int fd, char *devname,
 	unsigned long long array_size;
 	int done;
 	struct mdinfo *sra = NULL;
+	int already_running;
 
 	msg = analyse_change(info, &reshape);
 	if (msg) {
@@ -1995,10 +1996,15 @@ started:
 		}
 	}
 
-	err = start_reshape(sra, (info->reshape_active && !st->ss->external));
+	already_running = info->reshape_active &&
+		restart ? restart : !st->ss->external;
+	dprintf("Reshape will be %s\n",
+		already_running ? "continued" : "started");
+	err = start_reshape(sra, already_running);
 	if (err) {
-		fprintf(stderr, Name ": Cannot start reshape for %s\n",
-			devname);
+		fprintf(stderr, Name ": Cannot %s reshape for %s\n",
+				already_running ? "continue" : "start",
+				devname);
 		goto release;
 	}
 	if (restart)
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help