1
0
mirror of git://sourceware.org/git/lvm2.git synced 2024-10-27 10:25:13 +03:00

metadata: enhance internal error

Consider missing config tree from vg read to be an internal error
since we do not want to 'regenerate' this one in expesive parsing way.

Also if there is any failure on recreating committed VG, make it also
a 'vg_write' error.
This commit is contained in:
Zdenek Kabelac 2021-10-01 13:45:34 +02:00
parent b7e9ec0cbf
commit 98c57f7ce4

View File

@ -5225,14 +5225,14 @@ struct volume_group *vg_read(struct cmd_context *cmd, const char *vg_name, const
} }
if (!vg->committed_cft) { if (!vg->committed_cft) {
log_warn("WARNING: vg_read no vg copy: copy export failed."); log_error(INTERNAL_ERROR "Missing committed config tree.");
if (!(vg->committed_cft = export_vg_to_config_tree(vg))) goto out;
goto out;
} }
if (!(vg->vg_committed = import_vg_from_config_tree(cmd, vg->fid, vg->committed_cft))) if (!(vg->vg_committed = import_vg_from_config_tree(cmd, vg->fid, vg->committed_cft))) {
log_warn("WARNING: vg_read no vg copy: copy import failed."); log_error("Failed to import written VG.");
goto out;
}
} else { } else {
if (vg->vg_precommitted) if (vg->vg_precommitted)
log_error(INTERNAL_ERROR "vg_read vg %p vg_precommitted %p", (void *)vg, (void *)vg->vg_precommitted); log_error(INTERNAL_ERROR "vg_read vg %p vg_precommitted %p", (void *)vg, (void *)vg->vg_precommitted);