diff options
author | Dave Wysochanski <dwysocha@redhat.com> | 2007-05-31 20:10:25 +0000 |
---|---|---|
committer | Dave Wysochanski <dwysocha@redhat.com> | 2007-05-31 20:10:25 +0000 |
commit | 3008bc4432817f9fb4311c8aae7340267004eeb6 (patch) | |
tree | a4de66ae5d6b779503916e2de03b1b7a47170248 /tools/pvdisplay.c | |
parent | dda1e6c983c91f66a47805ea761ab4685be811fc (diff) | |
download | lvm2-3008bc4432817f9fb4311c8aae7340267004eeb6.tar.gz |
Fix redundant segment display when PV is given to 'pvdisplay --maps' cmdline.
Diffstat (limited to 'tools/pvdisplay.c')
-rw-r--r-- | tools/pvdisplay.c | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/tools/pvdisplay.c b/tools/pvdisplay.c index 42b146dc3..3258cea89 100644 --- a/tools/pvdisplay.c +++ b/tools/pvdisplay.c @@ -22,6 +22,7 @@ static int _pvdisplay_single(struct cmd_context *cmd, int consistent = 0; int ret = ECMD_PROCESSED; uint64_t size; + struct physical_volume *pv_temp; const char *pv_name = dev_name(pv->dev); @@ -43,7 +44,21 @@ static int _pvdisplay_single(struct cmd_context *cmd, ret = ECMD_FAILED; goto out; } - } + + /* + * Replace possibly incomplete PV structure with new one + * allocated in vg_read() path. + */ + pv_temp = find_pv(vg, pv->dev); + if (!pv_temp) { + log_error("Unable to find physical volume %s " + "in volume group %s", + pv_name, pv->vg_name); + ret = ECMD_FAILED; + goto out; + } + pv = pv_temp; + } if (!*pv->vg_name) size = pv->size; |