init_dmeventd_monitor(lp->activation_monitoring);
- if (seg_is_thin_pool(lp) || seg_is_thin(lp)) {
- if (!activate_lv_excl(cmd, lv)) {
+ if (seg_is_thin(lp)) {
+ if ((lp->activate == CHANGE_AY) ||
+ (lp->activate == CHANGE_ALY))
+ lp->activate = CHANGE_AE;
+ if ((lp->activate == CHANGE_AE) &&
+ !activate_lv_excl(cmd, lv)) {
log_error("Aborting. Failed to activate thin %s.",
lv->name);
goto deactivate_and_revert_new_lv;
lp->snapshot ? "snapshot exception store" :
"start of new LV");
goto deactivate_and_revert_new_lv;
- } else if (seg_is_thin_volume(lp)) {
+ } else if (seg_is_thin_volume(lp) && (lp->activate == CHANGE_AE)) {
/* FIXME: for now we may drop any queued thin messages
* since we are sure everything was activated already */
if (!detach_pool_messages(first_seg(lv)->pool_lv)) {
"exclusively", lv->name);
if (!activate_lv_excl(cmd, lv))
return_0;
+ /* Drop any left thin messages after activation */
+ if (lv_is_thin_volume(lv) &&
+ !detach_pool_messages(first_seg(lv)->pool_lv))
+ return_0;
} else if (activate == CHANGE_ALY) {
log_verbose("Activating logical volume \"%s\" locally",
lv->name);
stack;
continue;
}
+ /* Drop any left thin messages after activation */
+ if (lv_is_thin_volume(lv) &&
+ !detach_pool_messages(first_seg(lv)->pool_lv)) {
+ stack;
+ continue;
+ }
} else if (activate == CHANGE_ALY) {
if (!activate_lv_local(cmd, lv)) {
stack;