Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=95fbbca4f1be486bb... Commit: 95fbbca4f1be486bb05cd99bd5d71f61dbd06015 Parent: 149dfe84901f3825d7576b66279322d35793d5ef Author: Peter Rajnoha prajnoha@redhat.com AuthorDate: Tue Mar 17 09:37:06 2015 +0100 Committer: Peter Rajnoha prajnoha@redhat.com CommitterDate: Fri Aug 21 11:15:53 2015 +0200
report: display 'unknown' value for pv_in_use field if PV extension version < 2
For example:
$ pvs -o pv_name,vg_name,pv_in_use PV VG InUse /dev/sda /dev/sdb vg used /dev/vda2 fedora unknown --- lib/report/report.c | 6 ++++-- 1 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/lib/report/report.c b/lib/report/report.c index 4b80eaf..21d2b05 100644 --- a/lib/report/report.c +++ b/lib/report/report.c @@ -2310,8 +2310,10 @@ static int _pvinuse_disp(struct dm_report *rh, struct dm_pool *mem, uint32_t ext_flags;
if (info) { - ext_flags = lvmcache_ext_flags(info); - return _binary_disp(rh, mem, field, ext_flags & PV_EXT_USED, GET_FIRST_RESERVED_NAME(pv_in_use_y), private); + if (lvmcache_ext_version(info) >= 2) { + ext_flags = lvmcache_ext_flags(info); + return _binary_disp(rh, mem, field, ext_flags & PV_EXT_USED, GET_FIRST_RESERVED_NAME(pv_in_use_y), private); + } }
return _binary_undef_disp(rh, mem, field, private);