Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
For bugs related to Red Hat Enterprise Linux 4 product line. The current stable release is 4.9. For Red Hat Enterprise Linux 6 and above, please visit Red Hat JIRA https://issues.redhat.com/secure/CreateIssue!default.jspa?pid=12332745 to report new issues.

Bug 248449

Summary: snap creation on inactive lv causes an invaild and "100% full" snapshot
Product: Red Hat Enterprise Linux 4 Reporter: Corey Marthaler <cmarthal>
Component: lvm2Assignee: Milan Broz <mbroz>
Status: CLOSED ERRATA QA Contact: Corey Marthaler <cmarthal>
Severity: low Docs Contact:
Priority: low    
Version: 4.5CC: agk, dwysocha, jbrassow, mbroz, prockai, pvrabec
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: RHBA-2007-0753 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2007-11-15 15:58:54 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
Proposed patch none

Description Corey Marthaler 2007-07-16 20:33:58 UTC
Description of problem:
[root@link-02 mnt]# vgcreate vg /dev/sd*1
  Volume group "vg" successfully created
[root@link-02 mnt]# lvcreate -n origin -L 5G vg
  Logical volume "origin" created
[root@link-02 mnt]# lvs -a -o +devices
  LV       VG         Attr   LSize  Origin Snap%  Move Log Copy%  Devices
  LogVol00 VolGroup00 -wi-ao 35.19G                               /dev/hda2(0)
  LogVol01 VolGroup00 -wi-ao  1.94G                               /dev/hda2(1126)
  origin   vg         -wi-a-  5.00G                               /dev/sda1(0)
[root@link-02 mnt]# lvcreate -s vg/origin -L 2G -n snap1
  Logical volume "snap1" created
[root@link-02 mnt]# lvs -a -o +devices
  LV       VG         Attr   LSize  Origin Snap%  Move Log Copy%  Devices
  LogVol00 VolGroup00 -wi-ao 35.19G                               /dev/hda2(0)
  LogVol01 VolGroup00 -wi-ao  1.94G                               /dev/hda2(1126)
  origin   vg         owi-a-  5.00G                               /dev/sda1(0)
  snap1    vg         swi-a-  2.00G origin   0.00                 /dev/sda1(1280)
[root@link-02 mnt]# lvchange -an vg/origin
[root@link-02 mnt]# lvs -a -o +devices
  LV       VG         Attr   LSize  Origin Snap%  Move Log Copy%  Devices
  LogVol00 VolGroup00 -wi-ao 35.19G                               /dev/hda2(0)
  LogVol01 VolGroup00 -wi-ao  1.94G                               /dev/hda2(1126)
  origin   vg         owi---  5.00G                               /dev/sda1(0)
  snap1    vg         swi---  2.00G origin                        /dev/sda1(1280)
[root@link-02 mnt]# vgsplit vg vg_newer /dev/sda1
  Volume group "vg_newer" successfully split from "vg"
[root@link-02 mnt]# lvs -a -o +devices
  LV       VG         Attr   LSize  Origin Snap%  Move Log Copy%  Devices
  LogVol00 VolGroup00 -wi-ao 35.19G                               /dev/hda2(0)
  LogVol01 VolGroup00 -wi-ao  1.94G                               /dev/hda2(1126)
  origin   vg_newer   owi---  5.00G                               /dev/sda1(0)
  snap1    vg_newer   swi---  2.00G origin                        /dev/sda1(1280)
[root@link-02 mnt]# lvcreate -s vg_newer/origin -L 2G -n snap4
  Logical volume "snap4" created
[root@link-02 mnt]# lvs -a -o +devices
  LV       VG         Attr   LSize  Origin Snap%  Move Log Copy%  Devices
  LogVol00 VolGroup00 -wi-ao 35.19G                               /dev/hda2(0)
  LogVol01 VolGroup00 -wi-ao  1.94G                               /dev/hda2(1126)
  origin   vg_newer   owi---  5.00G                               /dev/sda1(0)
  snap1    vg_newer   swi---  2.00G origin                        /dev/sda1(1280)
  snap4    vg_newer   Swi-I-  2.00G origin 100.00                 /dev/sda1(1792)

# Once it's re-activated, then it appears fine
[root@link-02 mnt]# lvchange -ay vg_newer/origin
[root@link-02 mnt]# lvs -a -o +devices
  LV       VG         Attr   LSize  Origin Snap%  Move Log Copy%  Devices
  LogVol00 VolGroup00 -wi-ao 35.19G                               /dev/hda2(0)
  LogVol01 VolGroup00 -wi-ao  1.94G                               /dev/hda2(1126)
  origin   vg_newer   owi-a-  5.00G                               /dev/sda1(0)
  snap1    vg_newer   swi-a-  2.00G origin   0.00                 /dev/sda1(1280)
  snap4    vg_newer   swi-a-  2.00G origin   0.00                 /dev/sda1(1792)



Version-Release number of selected component (if applicable):
2.6.9-55.8.ELsmp
lvm2-2.02.21-5.el4

How reproducible:
everytime

Comment 1 Milan Broz 2007-07-17 09:37:56 UTC
Reproduced, this is not vgsplit problem, any snapshot creation on inactive
logical volume create this invalid entry.

Temporary workaround is to use vgchange -a y after split.

Comment 2 Milan Broz 2007-07-17 12:09:08 UTC
Created attachment 159417 [details]
Proposed patch

Proposed patch

Comment 3 RHEL Program Management 2007-07-17 12:25:06 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 4 Milan Broz 2007-07-17 16:15:57 UTC
Fixed upstream in 2.02.27, this is regression introduced in 2.02.13.

Comment 7 Corey Marthaler 2007-07-27 18:50:58 UTC
fix verified in lvm2-2.02.27-1.el4.

Comment 9 errata-xmlrpc 2007-11-15 15:58:54 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 the 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-2007-0753.html