Bug 836663 - vgname missing from pvs output when PV contains ignored mda
vgname missing from pvs output when PV contains ignored mda
Status: CLOSED ERRATA
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: lvm2 (Show other bugs)
6.4
Unspecified Unspecified
high Severity medium
: rc
: 6.4
Assigned To: Alasdair Kergon
Cluster QE
: ZStream
Depends On:
Blocks: 773665 798635 836720 843808 896505
  Show dependency treegraph
 
Reported: 2012-06-29 16:54 EDT by Alasdair Kergon
Modified: 2013-02-21 03:11 EST (History)
16 users (show)

See Also:
Fixed In Version: lvm2-2.02.97-2.el6
Doc Type: Bug Fix
Doc Text:
When processing a PV that appears to be an orphan but contains an ignored mda, a scan needed to be triggered before the VG name field can be relied upon. The field is now displayed correctly first time.
Story Points: ---
Clone Of:
Environment:
Last Closed: 2013-02-21 03:11:06 EST
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:


Attachments (Terms of Use)

  None (edit)
Description Alasdair Kergon 2012-06-29 16:54:39 EDT
When processing a PV that appears to be an orphan but contains an ignored mda,
a scan needs to be triggered before the VG name field can be relied upon.

   > pvs -o +mda_count,vg_mda_count /dev/loop[0123]
      PV         VG   Fmt  Attr PSize  PFree  #PMda #VMda
      /dev/loop0 vg3  lvm2 a-   96.00m 96.00m     0     1
      /dev/loop1 vg3  lvm2 a-   96.00m 96.00m     1     1
      /dev/loop2 vg2  lvm2 a-   96.00m 96.00m     1     2
      /dev/loop3 vg2  lvm2 a-   28.00m 28.00m     1     2
    
    > pvs /dev/loop2 /dev/loop3 /dev/loop0 /dev/loop1 --unbuffered
      PV         VG   Fmt  Attr PSize   PFree
      /dev/loop2      lvm2 a--  100.00m 100.00m
      /dev/loop3 vg2  lvm2 a--   28.00m  28.00m
      /dev/loop0      lvm2 a--  100.00m 100.00m
      /dev/loop1 vg3  lvm2 a--   96.00m  96.00m
    
The blank VG entries should contain vg2 and vg3.
Comment 1 Alasdair Kergon 2012-06-29 16:56:32 EDT
Proposed fix:

https://lists.fedorahosted.org/pipermail/lvm2-commits/2012-June/000053.html

In process_each_pv() if we haven't yet scanned and the PV appears
to be an orphan, we must scan the other PVs looking for mdas that
reference it to find out what VG it is in.

1. If the PV has no mdas, we must scan.
2. If the PV has an mda that is not ignored we do not need to scan.
3. If the PV has an mda that is ignored, we do need to scan.
Comment 3 Alasdair Kergon 2012-06-29 17:02:40 EDT
Bug dates back to the introduction of ignored mdas in 2.02.69 in June 2010.
Comment 5 Corey Marthaler 2012-07-26 15:24:38 EDT
Adding QA ack for 6.4.

Devel will need to provide unit testing results however before this bug can be
ultimately verified by QA.
Comment 7 Alasdair Kergon 2012-08-08 08:18:23 EDT
See the linked commit message - testing involves creating PVs with/without mdas, putting them into VGs, then running 'pvs' with the PVs listed in various orders and seeing that the output in the VG column is always correct and doesn't depend on the order of the PVs on the command line.
Comment 12 Nenad Peric 2012-12-12 05:50:44 EST
Tested and marking verified with 

lvm2-2.02.98-4.el6

The order of PVs in pvs did not change the output when there was a mix of MDA-containing and MDA-ignored devices.
Comment 13 errata-xmlrpc 2013-02-21 03:11:06 EST
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

http://rhn.redhat.com/errata/RHBA-2013-0501.html

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