ret = 1;
bad:
- if (activated && !deactivate_lv(cmd, lock_lv)) {
- log_error("Problem deactivating %s.", display_lvname(lock_lv));
- ret = 0;
+ if (activated) {
+ if (!sync_local_dev_names(lock_lv->vg->cmd)) {
+ log_error("Failed to sync local devices before deactivating LV %s.",
+ display_lvname(lock_lv));
+ return 0;
+ }
+
+ if (!deactivate_lv(cmd, lock_lv)) {
+ log_error("Problem deactivating %s.", display_lvname(lock_lv));
+ ret = 0;
+ }
}
return ret;
if (is_origin_active &&
lv_is_virtual_origin(origin)) {
+ if (!sync_local_dev_names(origin->vg->cmd)) {
+ log_error("Failed to sync local devices before deactivating origin LV %s.",
+ display_lvname(origin));
+ return 0;
+ }
if (!deactivate_lv(origin->vg->cmd, origin)) {
log_error("Failed to deactivate logical volume \"%s\"",
origin->name);
}
}
+ if (!sync_local_dev_names(lv->vg->cmd)) {
+ log_error("Failed to sync local devices LV %s.",
+ display_lvname(lv));
+ return 0;
+ }
+
if (activate &&
!deactivate_lv(lv->vg->cmd, lv)) {
log_error("Failed to deactivate %s.", display_lvname(lv));
/* TODO: any active validation of cache-pool metadata? */
deactivate_mlv:
+ if (!sync_local_dev_names(cmd)) {
+ log_error("Failed to sync local devices before deactivating LV %s.",
+ display_lvname(mlv));
+ return 0;
+ }
+
if (!deactivate_lv(cmd, mlv)) {
log_error("Cannot deactivate pool metadata volume %s.",
display_lvname(mlv));
}
deactivate_pmslv:
+ if (!sync_local_dev_names(cmd)) {
+ log_error("Failed to sync local devices before deactivating LV %s.",
+ display_lvname(pmslv));
+ return 0;
+ }
+
if (!deactivate_lv(cmd, pmslv)) {
log_error("Cannot deactivate pool metadata spare volume %s.",
display_lvname(pmslv));