mirror of
git://sourceware.org/git/lvm2.git
synced 2025-03-25 18:50:51 +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:
parent
b7e9ec0cbf
commit
98c57f7ce4
@ -5225,14 +5225,14 @@ struct volume_group *vg_read(struct cmd_context *cmd, const char *vg_name, const
|
||||
}
|
||||
|
||||
if (!vg->committed_cft) {
|
||||
log_warn("WARNING: vg_read no vg copy: copy export failed.");
|
||||
if (!(vg->committed_cft = export_vg_to_config_tree(vg)))
|
||||
goto out;
|
||||
log_error(INTERNAL_ERROR "Missing committed config tree.");
|
||||
goto out;
|
||||
}
|
||||
|
||||
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.");
|
||||
|
||||
if (!(vg->vg_committed = import_vg_from_config_tree(cmd, vg->fid, vg->committed_cft))) {
|
||||
log_error("Failed to import written VG.");
|
||||
goto out;
|
||||
}
|
||||
} else {
|
||||
if (vg->vg_precommitted)
|
||||
log_error(INTERNAL_ERROR "vg_read vg %p vg_precommitted %p", (void *)vg, (void *)vg->vg_precommitted);
|
||||
|
Loading…
x
Reference in New Issue
Block a user