1
0
mirror of git://sourceware.org/git/lvm2.git synced 2024-10-27 10:25:13 +03:00

pvmove: in fork mode destroy bcache in child

When pvmove was run in background mode and forks
instead of using lvmpolld, the child pvmove process
was not clearing the bcache from the parent, so all
the aio ops in the child were failing.
This commit is contained in:
David Teigland 2018-04-25 16:23:55 -05:00
parent 0fe4f65f65
commit c7fdacbc50

View File

@ -377,8 +377,6 @@ static void _poll_for_all_vgs(struct cmd_context *cmd,
process_each_vg(cmd, 0, NULL, NULL, NULL, READ_FOR_UPDATE, 0, handle, _poll_vg);
if (!parms->outstanding_count)
break;
if (parms->interval)
dev_close_all();
_nanosleep(parms->interval, 1);
}
}
@ -618,6 +616,12 @@ static int _poll_daemon(struct cmd_context *cmd, struct poll_operation_id *id,
/*
* Process one specific task or all incomplete tasks?
*/
/* clear lvmcache/bcache/fds from the parent */
lvmcache_destroy(cmd, 1, 0);
label_scan_destroy(cmd);
dev_close_all();
if (id) {
if (!wait_for_single_lv(cmd, id, parms)) {
stack;
@ -626,6 +630,7 @@ static int _poll_daemon(struct cmd_context *cmd, struct poll_operation_id *id,
} else {
if (!parms->interval)
parms->interval = find_config_tree_int(cmd, activation_polling_interval_CFG, NULL);
if (!(handle = init_processing_handle(cmd, NULL))) {
log_error("Failed to initialize processing handle.");
ret = ECMD_FAILED;