summaryrefslogtreecommitdiffstats
path: root/Grow.c
diff options
context:
space:
mode:
authorNeilBrown <neilb@suse.de>2009-04-01 12:26:08 +1100
committerNeilBrown <neilb@suse.de>2009-04-01 12:26:08 +1100
commit93ecfa01d47f992a41694ef8c75f6e542bb5ffee (patch)
tree639b88981e0abc646fc8d921d00b8e1d8b1bd375 /Grow.c
parentb9d77223eb68a211410131b5b0895c547a6d5734 (diff)
downloadmdadm-93ecfa01d47f992a41694ef8c75f6e542bb5ffee.tar.gz
mdadm-93ecfa01d47f992a41694ef8c75f6e542bb5ffee.tar.xz
mdadm-93ecfa01d47f992a41694ef8c75f6e542bb5ffee.zip
grow: don't wait forever for critical section to pass.
If an array reshape completed within 1 second, then --grow will not notice that it has finished and will keep waiting for the critical section to pass. So be more cautious in the test. Signed-off-by: NeilBrown <neilb@suse.de>
Diffstat (limited to 'Grow.c')
-rw-r--r--Grow.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/Grow.c b/Grow.c
index 14e48f5..fc809c6 100644
--- a/Grow.c
+++ b/Grow.c
@@ -815,6 +815,14 @@ int Grow_reshape(char *devname, int fd, int quiet, char *backup_file,
}
if (comp >= nstripe)
break;
+ if (comp == 0) {
+ /* Maybe it finished already */
+ char action[20];
+ if (sysfs_get_str(sra, NULL, "sync_action",
+ action, 20) > 0 &&
+ strncmp(action, "reshape", 7) != 0)
+ break;
+ }
sleep(1);
}