summaryrefslogtreecommitdiff
path: root/Grow.c
diff options
context:
space:
mode:
authorPawel Baldysiak <pawel.baldysiak@intel.com>2014-07-16 12:20:34 +0200
committerNeilBrown <neilb@suse.de>2014-07-17 14:08:24 +1000
commit13ffbe89b6103c146c08eb1c9a70833306c8322b (patch)
tree14b8c07f033891898342ed29ae8a9e2bed532f3e /Grow.c
parent095b8088fa99ad1195d1aba03af2aa561b4a6379 (diff)
Grow: Do not try to restart if reshape is running
Grow process did not check if reshape is already started when deciding about restarting. Sync_action should be checked in this case, and if reshape is running - restart flag should not be set. Otherwise, Grow process will fail to write data to sysfs, and reshape will not be continued. Signed-off-by: Pawel Baldysiak <pawel.baldysiak@intel.com> Signed-off-by: Artur Paszkiewicz <artur.paszkiewicz@intel.com> Signed-off-by: NeilBrown <neilb@suse.de>
Diffstat (limited to 'Grow.c')
-rw-r--r--Grow.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/Grow.c b/Grow.c
index a2f4f142..ea9cc60e 100644
--- a/Grow.c
+++ b/Grow.c
@@ -2822,6 +2822,7 @@ static int reshape_array(char *container, int fd, char *devname,
unsigned long long array_size;
int done;
struct mdinfo *sra = NULL;
+ char buf[20];
/* when reshaping a RAID0, the component_size might be zero.
* So try to fix that up.
@@ -2869,7 +2870,9 @@ static int reshape_array(char *container, int fd, char *devname,
goto release;
}
- if (st->ss->external && restart && (info->reshape_progress == 0)) {
+ if (st->ss->external && restart && (info->reshape_progress == 0) &&
+ !((sysfs_get_str(info, NULL, "sync_action", buf, sizeof(buf)) > 0) &&
+ (strncmp(buf, "reshape", 7) == 0))) {
/* When reshape is restarted from '0', very begin of array
* it is possible that for external metadata reshape and array
* configuration doesn't happen.