mirror of
git://sourceware.org/git/lvm2.git
synced 2025-01-03 05:18:29 +03:00
Check for certain vg_read errors in _process_one_vg iterator.
In _process_one_vg, we should never proceed if the VG read fails with certain conditions. If we cannot allocate or construct the volume_group structure, we should not proceed - this is true regardless of the tool calling the iterator. In other cases, when the volume group structure is constructed but there is some error (PVs missing, metadata corrupted, etc), some tools may want to process the VG while others may not. Author: Dave Wysochanski <dwysocha@redhat.com>
This commit is contained in:
parent
1a4366df60
commit
b5fd1544d5
@ -431,6 +431,9 @@ static int _process_one_vg(struct cmd_context *cmd, const char *vg_name,
|
||||
log_verbose("Finding volume group \"%s\"", vg_name);
|
||||
|
||||
vg = vg_read(cmd, vg_name, vgid, flags);
|
||||
if (vg_read_error(vg) == FAILED_ALLOCATION ||
|
||||
vg_read_error(vg) == FAILED_NOTFOUND)
|
||||
return ECMD_FAILED;
|
||||
|
||||
if (!dm_list_empty(tags)) {
|
||||
/* Only process if a tag matches or it's on arg_vgnames */
|
||||
|
Loading…
Reference in New Issue
Block a user