master - monitoring: preserve monitoring status during update
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=dc8c5c1886ea7c090a3bfa96de8f22ca060614ec Commit: dc8c5c1886ea7c090a3bfa96de8f22ca060614ec Parent: eb51be4fbee95d76b53e5255242a8032c3028aa2 Author: Zdenek Kabelac <[email protected]> AuthorDate: Wed Jun 22 23:21:27 2016 +0200 Committer: Zdenek Kabelac <[email protected]> CommitterDate: Thu Jun 23 14:56:10 2016 +0200
monitoring: preserve monitoring status during update
Ignore monitoring during whole update (suspend/resume) of thin-pool.
--- WHATS_NEW | 1 + lib/metadata/thin_manip.c | 21 +++++++++++++-------- 2 files changed, 14 insertions(+), 8 deletions(-)
WHATS_NEW +1 -0
@@ -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.
lib/metadata/thin_manip.c +13 -8
@@ -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);