From 1a41e649a68b03fd6ea4769ed06e83f9d9785c45 Mon Sep 17 00:00:00 2001 From: Peter Rajnoha Date: Mon, 2 Mar 2015 13:00:37 +0100 Subject: [PATCH] metadata: vg: alloc lvm1_system_id in alloc_vg sooner --- lib/metadata/vg.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/lib/metadata/vg.c b/lib/metadata/vg.c index 29936550f..2bed1ad59 100644 --- a/lib/metadata/vg.c +++ b/lib/metadata/vg.c @@ -41,6 +41,12 @@ struct volume_group *alloc_vg(const char *pool_name, struct cmd_context *cmd, return NULL; } + if (!(vg->lvm1_system_id = dm_pool_zalloc(vgmem, NAME_LEN + 1))) { + log_error("Failed to allocate VG systemd id."); + dm_pool_destroy(vgmem); + return NULL; + } + vg->cmd = cmd; vg->vgmem = vgmem; vg->alloc = ALLOC_NORMAL; @@ -57,12 +63,6 @@ struct volume_group *alloc_vg(const char *pool_name, struct cmd_context *cmd, dm_list_init(&vg->tags); dm_list_init(&vg->removed_pvs); - if (!(vg->lvm1_system_id = dm_pool_zalloc(vg->vgmem, NAME_LEN + 1))) { - log_error("Failed to allocate VG systemd id."); - dm_pool_destroy(vgmem); - return NULL; - } - log_debug_mem("Allocated VG %s at %p.", vg->name, vg); return vg; -- 2.43.5