Bug 491902 - vgcfgrestore can segfault if some PV is missing
vgcfgrestore can segfault if some PV is missing
Status: CLOSED ERRATA
Product: Red Hat Enterprise Linux 4
Classification: Red Hat
Component: lvm2 (Show other bugs)
4.8
All Linux
low Severity medium
: rc
: ---
Assigned To: Milan Broz
Cluster QE
:
Depends On:
Blocks: 494414
  Show dependency treegraph
 
Reported: 2009-03-24 11:48 EDT by Milan Broz
Modified: 2013-02-28 23:07 EST (History)
9 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
: 494414 (view as bug list)
Environment:
Last Closed: 2009-05-18 16:11:04 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Milan Broz 2009-03-24 11:48:32 EDT
Description of problem:

]# pvcreate /dev/sd[bc]
  Physical volume "/dev/sdb" successfully created
  Physical volume "/dev/sdc" successfully created
# vgcreate vg_test /dev/sd[bc]
  Volume group "vg_test" successfully created
# vgcfgbackup -f vg_test vg_test
  Volume group "vg_test" successfully backed up.

now some PV is lost...

# pvremove -ff /dev/sdb
...
  Labels on physical volume "/dev/sdb" successfully wiped

# vgcfgrestore -f vg_test vg_test
  Couldn't find device with uuid 'jYyR3Q-G601-hQYa-XLuB-z3Bb-nP1s-Bx8dYd'.
Segmentation fault

Version-Release number of selected component (if applicable):
# rpm -q lvm2
lvm2-2.02.42-4.el4


One liner patch already upstream.
Comment 2 Milan Broz 2009-03-24 17:20:12 EDT
Fixed in lvm2-2.02.42-5.el4
Comment 5 Corey Marthaler 2009-04-03 15:55:55 EDT
Fix has been verified in lvm2-2.02.42-5.el4 to no longer segfault, the restore will still fail however which I assume is expected. I'll add this test case to our regression testing.


[root@hayes-01 ~]# pvcreate /dev/etherd/e1.1p1  /dev/etherd/e1.1p2
  Physical volume "/dev/etherd/e1.1p1" successfully created
  Physical volume "/dev/etherd/e1.1p2" successfully created

[root@hayes-01 ~]# vgcreate vg_test /dev/etherd/e1.1p[12]
  Clustered volume group "vg_test" successfully created

[root@hayes-01 ~]# vgcfgbackup -f vg_test vg_test
  Volume group "vg_test" successfully backed up.

[root@hayes-01 ~]# pvremove -ff /dev/etherd/e1.1p2
Really WIPE LABELS from physical volume "/dev/etherd/e1.1p2" of volume group "vg_test" [y/n]? y
  WARNING: Wiping physical volume label from /dev/etherd/e1.1p2 of volume group "vg_test"
  Labels on physical volume "/dev/etherd/e1.1p2" successfully wiped

[root@hayes-01 ~]# pvscan
  Couldn't find device with uuid 'TC3zOa-SjT2-CKSH-ZlAN-B4qv-UbZW-HWDEPZ'.
  PV /dev/sda2            VG VolGroup00   lvm2 [74.38 GB / 0    free]
  PV /dev/etherd/e1.1p1   VG vg_test      lvm2 [1.77 TB / 1.77 TB free]
  PV unknown device       VG vg_test      lvm2 [1.77 TB / 1.77 TB free]
  Total: 3 [3.62 TB] / in use: 3 [3.62 TB] / in no VG: 0 [0   ]

[root@hayes-01 ~]# vgcfgrestore -f vg_test vg_test
  Couldn't find device with uuid 'TC3zOa-SjT2-CKSH-ZlAN-B4qv-UbZW-HWDEPZ'.
  Restore failed.
Comment 7 errata-xmlrpc 2009-05-18 16:11:04 EDT
An advisory has been issued which should help the problem
described in this bug report. This report is therefore being
closed with a resolution of ERRATA. For more information
on therefore solution and/or where to find the updated files,
please follow the link below. You may reopen this bug report
if the solution does not work for you.

http://rhn.redhat.com/errata/RHBA-2009-0967.html

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