1
0
mirror of git://sourceware.org/git/lvm2.git synced 2024-12-21 13:34:40 +03:00

cache: check activation of volume activated

volume_list may silently skip activation which is then still reported as
success.
This commit is contained in:
Zdenek Kabelac 2014-10-03 23:48:42 +02:00
parent 75119d85b3
commit b37203c819
2 changed files with 11 additions and 5 deletions

View File

@ -1,5 +1,6 @@
Version 2.02.112 - Version 2.02.112 -
===================================== =====================================
Properly check if activation of removed cached LV really activated.
Lvremoving cached LV removes cachepool (keep with lvconvert --splitcache). Lvremoving cached LV removes cachepool (keep with lvconvert --splitcache).
Always remove spare LV with last removed pool volume. Always remove spare LV with last removed pool volume.
Support lvconvert --splitcache and --uncache of cached LV. Support lvconvert --splitcache and --uncache of cached LV.

View File

@ -229,11 +229,16 @@ int lv_cache_remove(struct logical_volume *cache_lv)
return 0; return 0;
} }
/* Active volume is needed (writeback only?) */ /* Localy active volume is needed (writeback only?) */
if (!lv_is_active_locally(cache_lv) && if (!lv_is_active_locally(cache_lv)) {
!activate_lv_excl_local(cache_lv->vg->cmd, cache_lv)) { cache_lv->status |= LV_TEMPORARY;
log_error("Failed to active cache locally %s.", cache_lv->name); if (!activate_lv_excl_local(cache_lv->vg->cmd, cache_lv) ||
return 0; !lv_is_active_locally(cache_lv)) {
log_error("Failed to active cache locally %s.",
display_lvname(cache_lv));
return 0;
}
cache_lv->status &= ~LV_TEMPORARY;
} }
/* /*