1
0
mirror of git://sourceware.org/git/lvm2.git synced 2025-01-17 06:04:23 +03:00

Fix temp table activation in mirror conversions not to happen in other cmds.

Fix temp table in mirror conversions to use always-present error not zero.
This commit is contained in:
Alasdair Kergon 2008-10-23 11:21:04 +00:00
parent 4422220970
commit 9e71c18092
2 changed files with 9 additions and 8 deletions

View File

@ -1,5 +1,7 @@
Version 2.02.42 -
===================================
Fix temp table activation in mirror conversions not to happen in other cmds.
Fix temp table in mirror conversions to use always-present error not zero.
Version 2.02.41 - 17th October 2008
===================================

View File

@ -2380,30 +2380,29 @@ struct logical_volume *insert_layer_for_lv(struct cmd_context *cmd,
return NULL;
}
if (strstr(name, "_mimagetmp")) {
log_very_verbose("Creating transient 'zero' LV"
" for Mirror -> mirror up-convert.");
if (lv_is_active(lv_where) && strstr(name, "_mimagetmp")) {
log_very_verbose("Creating transient LV %s for mirror conversion in VG %s.", name, lv_where->vg->name);
segtype = get_segtype_from_string(cmd, "zero");
segtype = get_segtype_from_string(cmd, "error");
if (!lv_add_virtual_segment(layer_lv, 0, lv_where->le_count, segtype)) {
log_error("Creation of intermediate layer LV failed.");
log_error("Creation of transient LV %s for mirror conversion in VG %s failed.", name, lv_where->vg->name);
return NULL;
}
if (!vg_write(lv_where->vg)) {
log_error("Failed to write intermediate VG metadata");
log_error("Failed to write intermediate VG %s metadata for mirror conversion.", lv_where->vg->name);
return NULL;
}
if (!vg_commit(lv_where->vg)) {
log_error("Failed to commit intermediate VG metadata");
log_error("Failed to commit intermediate VG %s metadata for mirror conversion.", lv_where->vg->name);
vg_revert(lv_where->vg);
return NULL;
}
if (!activate_lv(cmd, layer_lv)) {
log_error("Failed to resume intermediate 'zero' LV, %s", name);
log_error("Failed to resume transient error LV %s for mirror conversion in VG %s.", name, lv_where->vg->name);
return NULL;
}
}