1
0
mirror of git://sourceware.org/git/lvm2.git synced 2025-01-17 06:04:23 +03:00

thin: fix update_pool_lv error path

When update fails in suspend() (sending of messages
fails because metadata space is full) call resume(),
so the locking sequence works properly for clustering.

Also failing deactivation should unlock memory.
This commit is contained in:
Zdenek Kabelac 2016-02-19 11:18:41 +01:00
parent 04ab1fa572
commit eefcbd5b28
2 changed files with 14 additions and 7 deletions

View File

@ -1,5 +1,6 @@
Version 2.02.143 - Version 2.02.143 -
===================================== =====================================
Fix error path when sending thin-pool message fails in update_pool_lv().
Support reporting CheckNeeded and Fail state for thin-pool and thin LV. Support reporting CheckNeeded and Fail state for thin-pool and thin LV.
For failing thin-pool and thin volume correctly report percentage as INVALID. For failing thin-pool and thin volume correctly report percentage as INVALID.
Report -1, not 'unkown' for lv_{snapshot_invalid,merge_failed} with --binary. Report -1, not 'unkown' for lv_{snapshot_invalid,merge_failed} with --binary.

View File

@ -469,16 +469,22 @@ int update_pool_lv(struct logical_volume *lv, int activate)
if (!(ret = _check_pool_create(lv))) if (!(ret = _check_pool_create(lv)))
stack; /* Safety guard, needs local presence of thin-pool target */ stack; /* Safety guard, needs local presence of thin-pool target */
else if (!(ret = suspend_lv_origin(lv->vg->cmd, lv))) else {
/* Send messages */ if (!(ret = suspend_lv_origin(lv->vg->cmd, lv)))
log_error("Failed to suspend and send message %s.", display_lvname(lv)); /* Send messages */
else if (!(ret = resume_lv_origin(lv->vg->cmd, lv))) log_error("Failed to suspend %s with queued messages.", display_lvname(lv));
log_error("Failed to resume %s.", display_lvname(lv));
/* Even failing suspend needs resume */
if (!resume_lv_origin(lv->vg->cmd, lv)) {
log_error("Failed to resume %s.", display_lvname(lv));
ret = 0;
}
}
if (activate) { if (activate) {
if (!deactivate_lv(lv->vg->cmd, lv)) { if (!deactivate_lv(lv->vg->cmd, lv)) {
init_dmeventd_monitor(monitored); log_error("Failed to deactivate %s.", display_lvname(lv));
return_0; ret = 0;
} }
init_dmeventd_monitor(monitored); init_dmeventd_monitor(monitored);
} }