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 5 product line. The current stable release is 5.10. 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 244215

Summary: kernel dm snapshot: activating of snapshot marked invalid causes incorrect mapping
Product: Red Hat Enterprise Linux 5 Reporter: Milan Broz <mbroz>
Component: kernelAssignee: Milan Broz <mbroz>
Status: CLOSED ERRATA QA Contact: Martin Jenner <mjenner>
Severity: medium Docs Contact:
Priority: medium    
Version: 5.0CC: agk, bleanhar, k.georgiou, pvrabec, rkenna, sven
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: RHBA-2007-0959 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2007-11-07 19:53:16 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:

Description Milan Broz 2007-06-14 15:33:44 UTC
+++ This bug was initially created as a clone of Bug #244214 +++
RHEL5 clone

Activation of volume group with overfilled snapshot (snapshot marked invalid in
metadata) causes incorrect mapping and causing userspace tools fails.

device-mapper: snapshot is marked invalid
device-mapper: Failed to read snapshot metadata
device-mapper: error adding target to table
  device-mapper: reload ioctl failed: Invalid argument


Snapshot should be "activated" normally but marked invalid only.

Also the mapping table for snapshot in kernel is then incorrect.

Reproducer script:
DEV=/dev/sdb1
VG=vg_test
LV=lv_test

pvcreate $DEV
vgcreate $VG $DEV
lvcreate -L 100M -n $LV $VG
lvcreate -s -L 4M -n "$LV"_snap $VG/$LV

#overfill snapshot
dd if=/dev/zero of=/dev/$VG/$LV bs=5M count=1
sync

vgchange -a n $VG

#activate VG with invalid snapshot
vgchange -a y $VG

#cleaning
vgchange -a n $VG
lvremove $VG/"$LV"_snap
lvremove $VG/"$LV"
vgremove $VG
pvremove $DEV

Comment 2 RHEL Program Management 2007-06-14 16:54:00 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 5 Don Zickus 2007-07-10 16:19:04 UTC
in 2.6.18-33.el5
You can download this test kernel from http://people.redhat.com/dzickus/el5

Comment 7 Milan Broz 2007-07-30 08:48:23 UTC
*** Bug 243130 has been marked as a duplicate of this bug. ***

Comment 8 Milan Broz 2007-09-13 16:46:21 UTC
*** Bug 251326 has been marked as a duplicate of this bug. ***

Comment 10 errata-xmlrpc 2007-11-07 19:53:16 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-0959.html