Bug 452606

Summary: lvchange -an writes error messages when physical volumes without metadata are used
Product: Red Hat Enterprise Linux 4 Reporter: Mikuláš Patočka <mpatocka>
Component: lvm2Assignee: Milan Broz <mbroz>
Status: CLOSED ERRATA QA Contact: Corey Marthaler <cmarthal>
Severity: high Docs Contact:
Priority: high    
Version: 4.7CC: agk, coughlan, dwysocha, edamato, heinzm, jbrassow, lhh, mbroz, prockai, pvrabec, riek
Target Milestone: rc   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2009-05-18 20:10:17 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
The output of lvchange -vvvv -an vg-test/lv none

Description Mikuláš Patočka 2008-06-24 00:46:29 UTC
Description of problem:

When physical volumes without metadata are used, "lvchange -an" and "lvremove"
commands writes error messages. Despite the messages, the operation is finished
correctly.

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

The bug happens in LVM2.2.02.38 (and some previous versions) and in current CVS

How reproducible:

always

Steps to Reproduce:

Run this script:
(assuming that you have devices /dev/mapper/loop5 and
/dev/mapper/loop6 --- or you can do it with any other devices)

cp /dev/zero /dev/mapper/loop5
cp /dev/zero /dev/mapper/loop6
pvcreate /dev/mapper/loop5
pvcreate --metadatacopies 0 /dev/mapper/loop6
vgcreate vg-test /dev/mapper/loop5 /dev/mapper/loop6
lvcreate -L 12M -n lv vg-test
lvchange -an vg-test/lv


Actual results:

cp: writing `/dev/mapper/loop5': No space left on device
cp: writing `/dev/mapper/loop6': No space left on device
  Physical volume "/dev/mapper/loop5" successfully created
  Physical volume "/dev/mapper/loop6" successfully created
  Volume group "vg-test" successfully created
  Logical volume "lv" created
  /dev/vg-test/lv: stat failed: No such file or directory
  Path /dev/vg-test/lv no longer valid for device(254,2)
  /dev/mapper/vg--test-lv: stat failed: No such file or directory
  Path /dev/mapper/vg--test-lv no longer valid for device(254,2)

Expected results:

cp: writing `/dev/mapper/loop5': No space left on device
cp: writing `/dev/mapper/loop6': No space left on device
  Physical volume "/dev/mapper/loop5" successfully created
  Physical volume "/dev/mapper/loop6" successfully created
  Volume group "vg-test" successfully created
  Logical volume "lv" created

Additional info:

If you run lvremove instead of lvcreate, similar error messages happen.

Comment 1 Mikuláš Patočka 2008-06-24 00:53:19 UTC
Created attachment 310089 [details]
The output of lvchange -vvvv -an vg-test/lv

lvchange -vvvv output. Note "Cached VG vg-test had incorrect PV list" messages.
This is probably related to bug #450651

Comment 2 Mikuláš Patočka 2008-06-24 01:24:10 UTC
Backtrace:

Breakpoint 3, dev_name_confirmed (dev=0x8465ef0, quiet=0)
    at device/dev-cache.c:662
662                     if (r < 0) {
(gdb) bt
#0  dev_name_confirmed (dev=0x8465ef0, quiet=0) at device/dev-cache.c:662
#1  0x08086f36 in dev_open_flags (dev=0x8465ef0, flags=2, direct=1, quiet=0)
    at device/dev-io.c:353
#2  0x08087505 in dev_open (dev=0x8465ef0) at device/dev-io.c:459
#3  0x0809d12a in label_read (dev=0x8465ef0, result=0xbf840ec0,
scan_sector=0)
    at label/label.c:275
#4  0x0807b0cf in lvmcache_label_scan (cmd=0x83e8008, full_scan=2)
    at cache/lvmcache.c:453
#5  0x080ac32c in _vg_read (cmd=0x83e8008, vgname=0x8502620 "vg1",
    vgid=0xbf842148
"ZhhUn3fV39BkWTwrrJXLsN5feGXbHiPnmYcX1QK7jvtnRsnlbZaW7ewAkWWmXWhM",
consistent=0xbf840fcc, precommitted=0) at metadata/metadata.c:1593
#6  0x080acb3f in _vg_read_by_vgid (cmd=0x83e8008,
    vgid=0xbf842148
"ZhhUn3fV39BkWTwrrJXLsN5feGXbHiPnmYcX1QK7jvtnRsnlbZaW7ewAkWWmXWhM",
precommitted=0) at metadata/metadata.c:1761
#7  0x080acd83 in lv_from_lvid (cmd=0x83e8008,
    lvid_s=0xbf842148
"ZhhUn3fV39BkWTwrrJXLsN5feGXbHiPnmYcX1QK7jvtnRsnlbZaW7ewAkWWmXWhM",
precommitted=0) at metadata/metadata.c:1819
#8  0x08079aaf in _lv_resume (cmd=0x83e8008,
    lvid_s=0xbf842148
"ZhhUn3fV39BkWTwrrJXLsN5feGXbHiPnmYcX1QK7jvtnRsnlbZaW7ewAkWWmXWhM",
error_if_not_active=0) at activate/activate.c:910
#9  0x08079c21 in lv_resume_if_active (cmd=0x83e8008,
    lvid_s=0xbf842148
"ZhhUn3fV39BkWTwrrJXLsN5feGXbHiPnmYcX1QK7jvtnRsnlbZaW7ewAkWWmXWhM") at
activate/activate.c:939
#10 0x080c9b3d in _file_lock_resource (cmd=0x83e8008,
---Type <return> to continue, or q <return> to quit---
    resource=0xbf842148
"ZhhUn3fV39BkWTwrrJXLsN5feGXbHiPnmYcX1QK7jvtnRsnlbZaW7ewAkWWmXWhM",
flags=30) at locking/file_locking.c:235
#11 0x0809e32a in _lock_vol (cmd=0x83e8008,
    resource=0xbf842148
"ZhhUn3fV39BkWTwrrJXLsN5feGXbHiPnmYcX1QK7jvtnRsnlbZaW7ewAkWWmXWhM",
flags=30) at locking/locking.c:336
#12 0x0809e513 in lock_vol (cmd=0x83e8008,
    vol=0x84eac38
"ZhhUn3fV39BkWTwrrJXLsN5feGXbHiPnmYcX1QK7jvtnRsnlbZaW7ewAkWWmXWhM",
flags=24) at locking/locking.c:389
#13 0x0805288c in lvchange_availability (cmd=0x83e8008, lv=0x84eac38)
    at lvchange.c:119
#14 0x08054cfc in lvchange_single (cmd=0x83e8008, lv=0x84eac38, handle=0x0)
    at lvchange.c:659
#15 0x0806ba77 in process_each_lv_in_vg (cmd=0x83e8008, vg=0x84ea820,
    arg_lvnames=0xbf84238c, tags=0xbf842394, handle=0x0,
    process_single=0x8054663 <lvchange_single>) at toollib.c:203
#16 0x0806c3a5 in process_each_lv (cmd=0x83e8008, argc=1, argv=0xbf842550,
    lock_type=36, handle=0x0, process_single=0x8054663 <lvchange_single>)
    at toollib.c:401
#17 0x080551f0 in lvchange (cmd=0x83e8008, argc=1, argv=0xbf842550)
    at lvchange.c:722
#18 0x0805f632 in lvm_run_command (cmd=0x83e8008, argc=1, argv=0xbf842550)
    at lvmcmdline.c:936
#19 0x0806023c in lvm2_main (argc=3, argv=0xbf842548, is_static=0)
    at lvmcmdline.c:1224
---Type <return> to continue, or q <return> to quit---
#20 0x08077726 in main (argc=0, argv=0x0) at lvm.c:21


Comment 6 RHEL Program Management 2008-09-05 17:04:04 UTC
This request was evaluated by Red Hat Product Management for inclusion in a Red
Hat Enterprise Linux maintenance release.  Product Management has requested
further review of this request by Red Hat Engineering, for potential
inclusion in a Red Hat Enterprise Linux Update release for currently deployed
products.  This request is not yet committed for inclusion in an Update
release.

Comment 7 Milan Broz 2008-12-16 16:54:31 UTC
In CVS - lvm2-2.02.42-1.el4

Comment 9 Corey Marthaler 2009-04-21 19:15:52 UTC
Fix verified in lvm2-2.02.42-5.el4.

[root@grant-01 ~]# pvs -o +mda_count,tags
  PV                   VG         Fmt  Attr PSize  PFree  #PMda PV Tags
  /dev/mapper/mpath0p1 grant      lvm2 a-   90.82G 90.81G     0        
  /dev/mapper/mpath1p1 grant      lvm2 a-   90.82G 90.82G     1        
  /dev/sda2            VolGroup00 lvm2 a-   74.38G     0      1        
[root@grant-01 ~]# lvchange -an grant/linear
[root@grant-01 ~]#

Comment 11 errata-xmlrpc 2009-05-18 20:10:17 UTC
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