diff options
author | NeilBrown <neilb@suse.de> | 2009-04-01 03:26:08 +0200 |
---|---|---|
committer | NeilBrown <neilb@suse.de> | 2009-04-01 03:26:08 +0200 |
commit | 93ecfa01d47f992a41694ef8c75f6e542bb5ffee (patch) | |
tree | 639b88981e0abc646fc8d921d00b8e1d8b1bd375 /Grow.c | |
parent | Release mdadm-3.0-devel3 (diff) | |
download | 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.c | 8 |
1 files changed, 8 insertions, 0 deletions
@@ -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); } |