summaryrefslogtreecommitdiff
path: root/tools/vgcreate.c
diff options
context:
space:
mode:
authorDavid Teigland <teigland@redhat.com>2022-07-05 17:08:00 -0500
committerDavid Teigland <teigland@redhat.com>2022-07-06 10:10:58 -0500
commit92b4fcf57f3c6d212d06b72b097e1a06e6efb84b (patch)
tree0374dbb21837fc5e051c5508c65b30b883069370 /tools/vgcreate.c
parentd0f94e763d6e6bca491c74cea93ec3062f32757e (diff)
downloadlvm2-92b4fcf57f3c6d212d06b72b097e1a06e6efb84b.tar.gz
exit with error when --devicesfile name doesn't exist
Diffstat (limited to 'tools/vgcreate.c')
-rw-r--r--tools/vgcreate.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/tools/vgcreate.c b/tools/vgcreate.c
index dde3f1eac..14608777f 100644
--- a/tools/vgcreate.c
+++ b/tools/vgcreate.c
@@ -84,7 +84,10 @@ int vgcreate(struct cmd_context *cmd, int argc, char **argv)
cmd->create_edit_devices_file = 1;
- lvmcache_label_scan(cmd);
+ if (!lvmcache_label_scan(cmd)) {
+ unlock_vg(cmd, NULL, vp_new.vg_name);
+ return_ECMD_FAILED;
+ }
if (lvmcache_vginfo_from_vgname(vp_new.vg_name, NULL)) {
unlock_vg(cmd, NULL, vp_new.vg_name);