summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorZdenek Kabelac <zkabelac@redhat.com>2021-10-01 13:45:34 +0200
committerZdenek Kabelac <zkabelac@redhat.com>2021-10-06 15:39:58 +0200
commit98c57f7ce44788f22499f10f8d6c3f320869aa16 (patch)
tree88fc1d073cdaa2b8a8eb17e70dfb2e47505c6369 /lib
parentb7e9ec0cbf55e4a4e1f027be49bf45b11beb5a76 (diff)
downloadlvm2-98c57f7ce44788f22499f10f8d6c3f320869aa16.tar.gz
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.
Diffstat (limited to 'lib')
-rw-r--r--lib/metadata/metadata.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/lib/metadata/metadata.c b/lib/metadata/metadata.c
index f29e73c7c..146ce476d 100644
--- a/lib/metadata/metadata.c
+++ b/lib/metadata/metadata.c
@@ -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);