1
0
mirror of git://sourceware.org/git/lvm2.git synced 2024-12-21 13:34:40 +03:00

monitoring: preserve monitoring status during update

Ignore monitoring during whole update (suspend/resume) of thin-pool.
This commit is contained in:
Zdenek Kabelac 2016-06-22 23:21:27 +02:00
parent eb51be4fbe
commit dc8c5c1886
2 changed files with 14 additions and 8 deletions

View File

@ -1,5 +1,6 @@
Version 2.02.158 -
=================================
Preserve monitoring status when updating thin-pool metadata.
Rerurn 0 (inactive) when status cannot be queried in _lv_active().
Switch to log_warn() for failing activation status query.
Refactor lvconvert argument handling code.

View File

@ -451,9 +451,15 @@ int update_pool_lv(struct logical_volume *lv, int activate)
if (activate) {
/* If the pool is not active, do activate deactivate */
monitored = dmeventd_monitor_mode();
init_dmeventd_monitor(DMEVENTD_MONITOR_IGNORE);
if (!lv_is_active(lv)) {
monitored = dmeventd_monitor_mode();
init_dmeventd_monitor(DMEVENTD_MONITOR_IGNORE);
/*
* FIXME:
* Rewrite activation code to handle whole tree of thinLVs
* as this version has major problem when it does not know
* which Node has pool active.
*/
if (!activate_lv_excl(lv->vg->cmd, lv)) {
init_dmeventd_monitor(monitored);
return_0;
@ -481,13 +487,12 @@ int update_pool_lv(struct logical_volume *lv, int activate)
}
}
if (activate) {
if (!deactivate_lv(lv->vg->cmd, lv)) {
log_error("Failed to deactivate %s.", display_lvname(lv));
ret = 0;
}
init_dmeventd_monitor(monitored);
if (activate &&
!deactivate_lv(lv->vg->cmd, lv)) {
log_error("Failed to deactivate %s.", display_lvname(lv));
ret = 0;
}
init_dmeventd_monitor(monitored);
/* Unlock memory if possible */
memlock_unlock(lv->vg->cmd);