diff options
author | NeilBrown <neilb@suse.de> | 2010-12-16 09:07:51 +1100 |
---|---|---|
committer | NeilBrown <neilb@suse.de> | 2010-12-16 09:07:51 +1100 |
commit | 885f984583a08bd64ea0e3e04abc0712828a1276 (patch) | |
tree | f359bc618329b5df252eb16cc65d39ad95e6f667 /msg.c | |
parent | d7ca196cbda7ec5e6d2a3139a5545e3e0d57a67e (diff) |
Grow: be extra careful about races when freezing an array
If any subarray has any spare devices, then something raced,
and we should abort the reshape.
Signed-off-by: NeilBrown <neilb@suse.de>
Diffstat (limited to 'msg.c')
-rw-r--r-- | msg.c | 13 |
1 files changed, 12 insertions, 1 deletions
@@ -348,8 +348,19 @@ int block_monitor(char *container, const int freeze) sysfs_get_str(sra, NULL, "sync_action", buf, 20) > 0 && strcmp(buf, "frozen\n") == 0)) /* pass */; - else + else { + unblock_subarray(sra, 0); break; + } + /* Double check against races - there should be no spares + * or part-spares + */ + sysfs_free(sra); + sra = sysfs_read(-1, e->devnum, GET_DEVS | GET_STATE); + if (sra && sra->array.spare_disks > 0) { + unblock_subarray(sra, freeze); + break; + } } if (e) { |