summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZdenek Kabelac <zkabelac@redhat.com>2016-02-19 11:18:41 +0100
committerZdenek Kabelac <zkabelac@redhat.com>2016-02-19 11:25:56 +0100
commiteefcbd5b28aae6c0bed22a6ff8cb97141184083f (patch)
tree5148240a695d8dc5cf11c96ec02d41d6053555f3
parent04ab1fa572bbc6751463b137576bc733ec27b2ca (diff)
downloadlvm2-eefcbd5b28aae6c0bed22a6ff8cb97141184083f.tar.gz
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.
-rw-r--r--WHATS_NEW1
-rw-r--r--lib/metadata/thin_manip.c20
2 files changed, 14 insertions, 7 deletions
diff --git a/WHATS_NEW b/WHATS_NEW
index 8d9294b3f..654f0a13f 100644
--- a/WHATS_NEW
+++ b/WHATS_NEW
@@ -1,5 +1,6 @@
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.
For failing thin-pool and thin volume correctly report percentage as INVALID.
Report -1, not 'unkown' for lv_{snapshot_invalid,merge_failed} with --binary.
diff --git a/lib/metadata/thin_manip.c b/lib/metadata/thin_manip.c
index 288625977..de3c7e8f2 100644
--- a/lib/metadata/thin_manip.c
+++ b/lib/metadata/thin_manip.c
@@ -469,16 +469,22 @@ int update_pool_lv(struct logical_volume *lv, int activate)
if (!(ret = _check_pool_create(lv)))
stack; /* Safety guard, needs local presence of thin-pool target */
- else if (!(ret = suspend_lv_origin(lv->vg->cmd, lv)))
- /* Send messages */
- log_error("Failed to suspend and send message %s.", display_lvname(lv));
- else if (!(ret = resume_lv_origin(lv->vg->cmd, lv)))
- log_error("Failed to resume %s.", display_lvname(lv));
+ else {
+ if (!(ret = suspend_lv_origin(lv->vg->cmd, lv)))
+ /* Send messages */
+ log_error("Failed to suspend %s with queued messages.", 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 (!deactivate_lv(lv->vg->cmd, lv)) {
- init_dmeventd_monitor(monitored);
- return_0;
+ log_error("Failed to deactivate %s.", display_lvname(lv));
+ ret = 0;
}
init_dmeventd_monitor(monitored);
}