struct logical_volume *lv;
struct lvinfo info;
int r = 0;
+ int messages_only = 0;
if (!activation())
return 1;
if (!(lv = lv_from_lvid(cmd, lvid_s, 0)))
goto_out;
+ if (lv_is_thin_pool(lv) && laopts->origin_only)
+ messages_only = 1;
+
if (!lv_is_origin(lv))
laopts->origin_only = 0;
if (!lv_info(cmd, lv, laopts->origin_only, &info, 0, 0))
goto_out;
- if (!info.exists || !info.suspended) {
+ if (!info.exists || !(info.suspended || messages_only)) {
if (error_if_not_active)
goto_out;
r = 1;
if (!deactivate_lv(lv->vg->cmd, lv))
return_0;
}
- /* If already active, do suspend resume
- *
- * TODO: Support pool resume without suspend,
- * since the real suspend is not needed here
+ /*
+ * Resume active pool to send thin messages.
+ * origin_only is used to skip check for resumed state
*/
- else if (!suspend_lv(lv->vg->cmd, lv)) {
- log_error("Failed to suspend %s.", lv->name);
- return 0;
- } else if (!resume_lv(lv->vg->cmd, lv)) {
+ else if (!resume_lv_origin(lv->vg->cmd, lv)) {
log_error("Failed to resume %s.", lv->name);
return 0;
}