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

lvmpolld: update to use new scanning correctly

This commit is contained in:
David Teigland 2018-04-13 14:40:00 -05:00
parent aa833bdd8a
commit 7b0a8f47be

View File

@ -126,6 +126,14 @@ static void _nanosleep(unsigned secs, unsigned allow_zero_time)
static void _sleep_and_rescan_devices(struct cmd_context *cmd, struct daemon_parms *parms)
{
if (parms->interval && !parms->aborting) {
/*
* FIXME: do we really need to drop everything and then rescan
* everything between each iteration? What change exactly does
* each iteration check for, and does seeing that require
* rescanning everything?
*/
lvmcache_destroy(cmd, 1, 0);
label_scan_destroy(cmd);
dev_close_all();
_nanosleep(parms->interval, 1);
lvmcache_label_scan(cmd);
@ -141,6 +149,9 @@ int wait_for_single_lv(struct cmd_context *cmd, struct poll_operation_id *id,
uint32_t lockd_state = 0;
int ret;
if (!parms->wait_before_testing)
lvmcache_label_scan(cmd);
/* Poll for completion */
while (!finished) {
if (parms->wait_before_testing)