Skip to contentSkip to conversation

LVM2/tools toollib.c

PATCH [email protected] 1 participant 1 message Jul 15, 2009

lore
Share & tools
lore
#0 lore raw

CVSROOT: /cvs/lvm2
Module name: LVM2
Changes by: wysochanski at sourceware.org 2009-07-15 05:23:20

Modified files:
tools : toollib.c

Log message:
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 <[email protected]>

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/tools/toollib.c.diff?cvsroot=lvm2&r1=1.160&r2=1.161

tools/toollib.c +3 -0
@@ -431,6 +431,9 @@
 	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 */