mirror of
git://sourceware.org/git/lvm2.git
synced 2024-12-21 13:34:40 +03:00
vgcfgrestore should not quietly fail when backup file has missing PVs.
(fixes previous commit: Fix segfault for vgcfgrestore on VG with missing PVs.)
This commit is contained in:
parent
761e574190
commit
0a5e42897e
@ -335,7 +335,7 @@ int backup_restore_from_file(struct cmd_context *cmd, const char *vg_name,
|
||||
const char *file)
|
||||
{
|
||||
struct volume_group *vg;
|
||||
int r = 0;
|
||||
int missing_pvs, r = 0;
|
||||
|
||||
/*
|
||||
* Read in the volume group from the text file.
|
||||
@ -343,11 +343,12 @@ int backup_restore_from_file(struct cmd_context *cmd, const char *vg_name,
|
||||
if (!(vg = backup_read_vg(cmd, vg_name, file)))
|
||||
return_0;
|
||||
|
||||
/*
|
||||
* If PV is missing, there is already message from read above
|
||||
*/
|
||||
if (!vg_missing_pv_count(vg))
|
||||
missing_pvs = vg_missing_pv_count(vg);
|
||||
if (missing_pvs == 0)
|
||||
r = backup_restore_vg(cmd, vg);
|
||||
else
|
||||
log_error("Cannot restore Volume Group %s with %i PVs "
|
||||
"marked as missing.", vg->name, missing_pvs);
|
||||
|
||||
vg_release(vg);
|
||||
return r;
|
||||
|
Loading…
Reference in New Issue
Block a user