diff options
author | Adam Kwolek <adam.kwolek@intel.com> | 2012-02-07 15:03:43 +0100 |
---|---|---|
committer | NeilBrown <neilb@suse.de> | 2012-02-09 12:20:52 +1100 |
commit | 78340e26a54db960de238b511f5cdc74aebe4453 (patch) | |
tree | 453a9b5a01b90b3bfea7fde8cf420efa5d6a5eb3 /Grow.c | |
parent | 50927b1323a4cfcbf3729ff552c496695d6199eb (diff) |
Flush mdmon before next reshape step during container operation
Using takeover operation for grow purposes, mdadm has to be sure
that mdmon processes all updates, and if necessary it will be closed
at takeover to raid0 operation. If mdmon is late, next array in container
is processed and due to race condition mdmon closes itself instead to monitor
next reshape operation.
Signed-off-by: Adam Kwolek <adam.kwolek@intel.com>
Signed-off-by: NeilBrown <neilb@suse.de>
Diffstat (limited to 'Grow.c')
-rw-r--r-- | Grow.c | 12 |
1 files changed, 10 insertions, 2 deletions
@@ -2003,6 +2003,9 @@ static int reshape_array(char *container, int fd, char *devname, if (reshape.level > 0 && st->ss->external) { /* make sure mdmon is aware of the new level */ + if (mdmon_running(st->container_dev)) + flush_mdmon(container); + if (!mdmon_running(st->container_dev)) start_mdmon(st->container_dev); ping_monitor(container); @@ -2396,8 +2399,7 @@ started: /* Re-load the metadata as much could have changed */ int cfd = open_dev(st->container_dev); if (cfd >= 0) { - ping_manager(container); - ping_monitor(container); + flush_mdmon(container); st->ss->free_super(st); st->ss->load_container(st, cfd, container); close(cfd); @@ -2594,6 +2596,9 @@ int reshape_container(char *container, char *devname, sysfs_init(content, fd, mdstat->devnum); + if (mdmon_running(devname2devnum(container))) + flush_mdmon(container); + rv = reshape_array(container, fd, adev, st, content, force, NULL, backup_file, quiet, 1, restart, @@ -2608,6 +2613,9 @@ int reshape_container(char *container, char *devname, restart = 0; if (rv) break; + + if (mdmon_running(devname2devnum(container))) + flush_mdmon(container); } if (!rv) unfreeze(st); |