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:
parent
3b97e8d643
commit
150e43a05c
@ -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. */
|
||||
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;
|
||||
|
Loading…
Reference in New Issue
Block a user