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 <neilb@suse.de>
This commit is contained in:
NeilBrown 2011-01-17 09:53:25 +11:00
parent 18eaf9e553
commit 6d5316f66a
1 changed files with 7 additions and 1 deletions

8
Grow.c
View File

@ -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 */
}
}