summaryrefslogtreecommitdiff
path: root/tools/vgcfgrestore.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/vgcfgrestore.c
parentd0f94e763d6e6bca491c74cea93ec3062f32757e (diff)
downloadlvm2-92b4fcf57f3c6d212d06b72b097e1a06e6efb84b.tar.gz
exit with error when --devicesfile name doesn't exist
Diffstat (limited to 'tools/vgcfgrestore.c')
-rw-r--r--tools/vgcfgrestore.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/tools/vgcfgrestore.c b/tools/vgcfgrestore.c
index e49313d14..9fcba89d4 100644
--- a/tools/vgcfgrestore.c
+++ b/tools/vgcfgrestore.c
@@ -132,7 +132,10 @@ int vgcfgrestore(struct cmd_context *cmd, int argc, char **argv)
clear_hint_file(cmd);
- lvmcache_label_scan(cmd);
+ if (!lvmcache_label_scan(cmd)) {
+ unlock_vg(cmd, NULL, vg_name);
+ return_ECMD_FAILED;
+ }
cmd->handles_unknown_segments = 1;