From 6d5316f66aed11f464d115a9dead4b15ec2bb246 Mon Sep 17 00:00:00 2001 From: NeilBrown Date: Mon, 17 Jan 2011 09:53:25 +1100 Subject: [PATCH] Be more careful checking why reshape has stopped. If reshape_position reports 'none', check array_state to see if array is still active. Signed-off-by: NeilBrown --- Grow.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/Grow.c b/Grow.c index 755d3d7c..76656847 100644 --- a/Grow.c +++ b/Grow.c @@ -2423,8 +2423,14 @@ check_progress: if (sysfs_get_str(info, NULL, "reshape_position", buf, sizeof(buf)) < 0 || strncmp(buf, "none", 4) != 0) return -2; /* abort */ - else + else { + /* Maybe racing with array shutdown - check state */ + if (sysfs_get_str(info, NULL, "array_state", buf, sizeof(buf)) < 0 + || strncmp(buf, "inactive", 8) == 0 + || strncmp(buf, "clear",5) == 0) + return -2; /* abort */ return -1; /* complete */ + } } -- 2.39.2