Skip to contentSkip to conversation

LVM2/lib/format_text format-text.c

PATCH [email protected] 1 participant 1 message Feb 28, 2011

lore
Share & tools
lore
#0 lore raw

CVSROOT: /cvs/lvm2
Module name: LVM2
Changes by: prajnoha at sourceware.org 2011-02-28 17:05:48

Modified files:
lib/format_text: format-text.c

Log message:
Use pv->vg_name directly instead of pv->vg->name in _text_pv_write.

This also prevents a possible segfault during an automatic repair when the PV does not belong to a VG anymore and we call pv_write_orphan.

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/format_text/format-text.c.diff?cvsroot=lvm2&r1=1.170&r2=1.171

lib/format_text/format-text.c +1 -2
@@ -1273,8 +1273,7 @@
 
 	/* Add a new cache entry with PV info or update existing one. */
 	if (!(info = lvmcache_add(fmt->labeller, (const char *) &pv->id,
-		      pv->dev, pv->vg ? pv->vg->name : FMT_TEXT_ORPHAN_VG_NAME,
-		      NULL, 0)))
+				  pv->dev, pv->vg_name, NULL, 0)))
 		return_0;
 
 	label = info->label;