RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 1020825 - Thin_check doesn't return error exit code for broken metadata
Summary: Thin_check doesn't return error exit code for broken metadata
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: device-mapper-persistent-data
Version: 7.0
Hardware: Unspecified
OS: Unspecified
high
medium
Target Milestone: rc
: 7.0
Assignee: Heinz Mauelshagen
QA Contact: yanfu,wang
URL:
Whiteboard:
Depends On: 1019217
Blocks:
TreeView+ depends on / blocked
 
Reported: 2013-10-18 10:52 UTC by Heinz Mauelshagen
Modified: 2023-03-08 07:26 UTC (History)
11 users (show)

Fixed In Version: 0.2.8-1.el7
Doc Type: Bug Fix
Doc Text:
Clone Of: 1019217
Environment:
Last Closed: 2014-06-13 13:12:25 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Comment 6 yanfu,wang 2013-12-05 06:07:33 UTC
Verified on device-mapper-persistent-data-0.2.8-2.el7:
# modprobe scsi_debug dev_size_mb=256 lbpu=1 lbpws10=1
# pvcreate /dev/sdn
# vgcreate vg /dev/sdn
# lvcreate -T -L20 -V10 -n LV1 vg/pool
# lvcreate -T -V10 -n LV2 vg/pool
# mkfs.ext2 /dev/vg/LV1
# mkfs.ext2 /dev/vg/LV2
# lvs -a vg
  LV              VG              Attr       LSize   Pool Origin Data%  Move Log Cpy%Sync Convert
  LV1             vg              Vwi-a-tz--  12.00m pool          5.21                          
  LV2             vg              Vwi-a-tz--  12.00m pool          5.21                          
  [lvol0_pmspare] vg              ewi-------   4.00m                                             
  pool            vg              twi-a-tz--  20.00m               6.25                          
  [pool_tdata]    vg              Twi-ao----  20.00m                                             
  [pool_tmeta]    vg              ewi-ao----   4.00m                                             

# lvchange -an vg/LV1
# lvchange -an vg/LV2
# lvchange -an vg/pool
# lvs -a vg

swap and dump metadata:
# lvcreate -n meta -L 8M vg
# lvconvert --poolmetadata vg/meta  --thinpool vg/pool
# lvchange -ay vg/meta
# thin_dump /dev/vg/meta >meta
# cat meta 
<superblock uuid="" time="0" transaction="2" data_block_size="128" nr_data_blocks="320">
  <device dev_id="1" mapped_blocks="10" transaction="0" creation_time="0" snap_time="0">
    <range_mapping origin_begin="0" data_begin="0" length="5" time="0"/>
    <range_mapping origin_begin="128" data_begin="5" length="4" time="0"/>
    <single_mapping origin_block="191" data_block="9" time="0"/>
  </device>
  <device dev_id="2" mapped_blocks="10" transaction="1" creation_time="0" snap_time="0">
    <range_mapping origin_begin="0" data_begin="10" length="5" time="0"/>
    <range_mapping origin_begin="128" data_begin="15" length="4" time="0"/>
    <single_mapping origin_block="191" data_block="19" time="0"/>
  </device>
</superblock> 

Single byte corruption in metadata:
# dd if=/dev/zero of=/dev/vg/meta bs=1 seek=40960 count=1
# thin_check /dev/vg/meta 
examining superblock
examining devices tree
examining mapping tree
  missing all mappings for devices: [3, -]
    bad checksum in btree node
  thin device 2 is missing mappings [3, 0]
    
[root@sun-x2270m2-01 ~]# echo $?
1
note: fixed version gives the correct 'failing' exit code now. 

# thin_dump /dev/vg/meta >meta2
metadata contains errors (run thin_check for details).
perhaps you wanted to run with --repair

repair metedata now:
# lvcreate -n fix -L 8M vg
# thin_repair -i /dev/vg/meta -o /dev/vg/fix
# echo $?
0
# thin_check /dev/vg/fix 
examining superblock
examining devices tree
examining mapping tree

Comment 7 Ludek Smid 2014-06-13 13:12:25 UTC
This request was resolved in Red Hat Enterprise Linux 7.0.

Contact your manager or support representative in case you have further questions about the request.


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