Bug 210922 - pvdisplay reports invalid PV size
Summary: pvdisplay reports invalid PV size
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Fedora
Classification: Fedora
Component: lvm2
Version: rawhide
Hardware: All
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Alasdair Kergon
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2006-10-16 15:50 UTC by Jan Blunck
Modified: 2007-11-30 22:11 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2007-01-10 18:35:33 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)
pvdisplay -vvv /dev/dasdb1 (26.16 KB, text/plain)
2006-10-17 12:37 UTC, Jan Blunck
no flags Details
lvm_dump.tgz (129.79 KB, application/x-compressed-tar)
2006-10-17 15:16 UTC, Jan Blunck
no flags Details

Description Jan Blunck 2006-10-16 15:50:00 UTC
Description of problem:
The size of old PVs (created with pvcreate from older LVM2 < 2.02.11) is
reported wrong.

Version-Release number of selected component (if applicable):
lvm2 2.02.11

How reproducible:
pvdisplay

Steps to Reproduce:
1. pvdisplay
2.
3.
  
Actual results:
The following shows 2 PVs, one old one (/dev/dasdb1) and one new (/dev/dasdc1).

s390vm02:~ # pvdisplay 
  --- Physical volume ---
  PV Name               /dev/dasdb1
  VG Name               test
  PV Size               0    / not usable 8589934592.00 TB
  Allocatable           yes 
  PE Size (KByte)       4096
  Total PE              586
  Free PE               486
  Allocated PE          100
  PV UUID               ivSa2k-N2Uf-EiHi-nmWJ-OM4W-ta98-VmcvFT
   
  --- NEW Physical volume ---
  PV Name               /dev/dasdc1
  VG Name               
  PV Size               2.29 GB
  Allocatable           NO
  PE Size (KByte)       0
  Total PE              0
  Free PE               0
  Allocated PE          0
  PV UUID               gwMml3-Agcw-YBvO-TCs4-Zs73-BpeA-ONcPzf
   
s390vm02:~ # 

Expected results:


Additional info:
pvs is working fine:
s390vm02:~ # pvs
  PV          VG   Fmt  Attr PSize PFree
  /dev/dasdb1 test lvm2 a-   2.29G 1.90G
  /dev/dasdc1      lvm2 --   2.29G 2.29G
s390vm02:~ #

Comment 1 Alasdair Kergon 2006-10-16 16:17:07 UTC
The PV size handling in the code prior to 2.0.11 was poor - multiple pieces of
code deduce it in inconsistent ways.  2.0.11 moved towards defining the size
unambiguously in a single place in the code.  This has revealed an existing bug
in pvdisplay: pv_read() is only valid for orphans, not for PVs in VGs. 
pvdisplay was using it for PVs in VGs instead of using vg_read().

Comment 2 Alasdair Kergon 2006-10-16 16:30:03 UTC
fixed in cvs

Comment 3 Jan Blunck 2006-10-17 12:34:35 UTC
No, this isn't fixed in the CVS yet. I'm not sure what is exactly failing here.
A short strace shows that at least all the devices are read without obvious
problems.

Attached is the log of pvdisplay -vvv /dev/dasdb1.


Comment 4 Jan Blunck 2006-10-17 12:37:41 UTC
Created attachment 138676 [details]
pvdisplay -vvv /dev/dasdb1

Comment 5 Alasdair Kergon 2006-10-17 14:17:50 UTC
Can you please attach a dump of the on disk metadata from both devices (using dd
or running scripts/lvm_dump.sh -m)?

Comment 6 Jan Blunck 2006-10-17 15:16:59 UTC
Created attachment 138689 [details]
lvm_dump.tgz

Comment 7 Alasdair Kergon 2006-10-20 18:56:08 UTC
A further update is reported to this.

But apparently pvmove was also broken by this in some way, which it is important
to have fixed.


Note You need to log in before you can comment on or make changes to this bug.