1
0
mirror of git://sourceware.org/git/lvm2.git synced 2025-01-03 05:18:29 +03:00

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.
This commit is contained in:
Peter Rajnoha 2011-02-28 17:05:48 +00:00
parent 3b97e8d643
commit 150e43a05c

View File

@ -1273,8 +1273,7 @@ static int _text_pv_write(const struct format_type *fmt, struct physical_volume
/* Add a new cache entry with PV info or update existing one. */ /* Add a new cache entry with PV info or update existing one. */
if (!(info = lvmcache_add(fmt->labeller, (const char *) &pv->id, if (!(info = lvmcache_add(fmt->labeller, (const char *) &pv->id,
pv->dev, pv->vg ? pv->vg->name : FMT_TEXT_ORPHAN_VG_NAME, pv->dev, pv->vg_name, NULL, 0)))
NULL, 0)))
return_0; return_0;
label = info->label; label = info->label;