diff --git a/WHATS_NEW b/WHATS_NEW index c88d981ac..7910cb832 100644 --- a/WHATS_NEW +++ b/WHATS_NEW @@ -1,5 +1,6 @@ Version 2.02.30 - =================================== + Fix a segfault if using pvs with --all argument. (2.02.29) Update --uuid argument description in man pages. Fix vgreduce PV list processing not to process every PV in the VG. (2.02.29) Extend lvconvert to use polldaemon. diff --git a/lib/metadata/metadata-exported.h b/lib/metadata/metadata-exported.h index aaf49423a..73211370c 100644 --- a/lib/metadata/metadata-exported.h +++ b/lib/metadata/metadata-exported.h @@ -312,6 +312,7 @@ struct list *get_vgids(struct cmd_context *cmd, int full_scan); int pv_write(struct cmd_context *cmd, struct physical_volume *pv, struct list *mdas, int64_t label_sector); +int is_pv(pv_t *pv); int is_orphan_vg(const char *vg_name); int is_orphan(pv_t *pv); vg_t *vg_lock_and_read(struct cmd_context *cmd, const char *vg_name, diff --git a/lib/metadata/metadata.c b/lib/metadata/metadata.c index f79a763da..1d3a0bc10 100644 --- a/lib/metadata/metadata.c +++ b/lib/metadata/metadata.c @@ -1832,6 +1832,15 @@ int is_orphan(pv_t *pv) return is_orphan_vg(pv_field(pv, vg_name)); } +/** + * is_pv - Determine whether a pv is a real pv or dummy one + * @pv: handle to device + */ +int is_pv(pv_t *pv) +{ + return (pv_field(pv, vg_name) ? 1 : 0); +} + /* * Returns: * 0 - fail diff --git a/tools/reporter.c b/tools/reporter.c index 2104414f0..83744dc96 100644 --- a/tools/reporter.c +++ b/tools/reporter.c @@ -91,7 +91,7 @@ static int _pvs_single(struct cmd_context *cmd, struct volume_group *vg, int ret = ECMD_PROCESSED; const char *vg_name = NULL; - if (!is_orphan(pv) && !vg) { + if (is_pv(pv) && !is_orphan(pv) && !vg) { vg_name = pv_vg_name(pv); if (!(vg = vg_lock_and_read(cmd, vg_name, (char *)&pv->vgid,