Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
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 1670154

Summary: xfs_repair may rebuild free inode btree with wrong magic number in some nodes
Product: Red Hat Enterprise Linux 7 Reporter: Eric Sandeen <esandeen>
Component: xfsprogsAssignee: Eric Sandeen <esandeen>
Status: CLOSED ERRATA QA Contact: Zorro Lang <zlang>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 7.6CC: xzhou
Target Milestone: rc   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: 1670153 Environment:
Last Closed: 2019-08-06 13:06:18 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:
Bug Depends On: 1670153    
Bug Blocks:    

Comment 2 Eric Sandeen 2019-02-05 16:58:27 UTC
Upstream:

commit 051dae5efb4fc7c1c47ccb72ff161241fb0815ee
Author: Brian Foster <bfoster>
Date:   Mon Jan 28 16:05:16 2019 -0600

    xfs_repair: initialize non-leaf finobt blocks with correct magic
    
    The free inode btree construction code in xfs_repair has a bug where
    any non-leaf nodes outside of the leftmost block at the associated
    level in the tree are incorrectly initialized with the inobt magic
    value. Update the prop_ino_cursor() path responsible for growing the
    non-leaf portion of the inode btrees to use the btnum of the
    specific tree being generated rather than the hardcoded inode btree
    type.
    
    Signed-off-by: Brian Foster <bfoster>
    Reported-by: Lucas Stach <l.stach>
    Root-caused-by: Lucas Stach <l.stach>
    Reviewed-by: Eric Sandeen <sandeen>
    Reviewed-by: Dave Chinner <dchinner>
    Signed-off-by: Eric Sandeen <sandeen>

Comment 3 Eric Sandeen 2019-02-11 20:34:36 UTC
built in xfsprogs-4.5.0-20.el7

Comment 5 Zorro Lang 2019-06-25 17:08:59 UTC
Reproduced this bug with xfsprogs-4.5.0-19.el7:

# xfs_repair finobt-lv3.img
# xfs_repair -n finobt-lv3.img
Phase 1 - find and verify superblock...
Phase 2 - using internal log
        - zero log...
        - scan filesystem freespace and inode maps...
bad magic # 0x49414233 in inobt block 0/2679678
bad magic # 0x49414233 in inobt block 0/2680093
        - found root inode chunk
Phase 3 - for each AG...
        - scan (but don't clear) agi unlinked lists...
        - process known inodes and perform inode discovery...
        - agno = 0
        - agno = 1
        - agno = 2
        - agno = 3
        - process newly discovered inodes...
Phase 4 - check for duplicate blocks...
        - setting up duplicate extent list...
        - check for inodes claiming duplicate blocks...
        - agno = 0
        - agno = 1
        - agno = 2
        - agno = 3
No modify flag set, skipping phase 5
Inode allocation btrees are too corrupted, skipping phases 6 and 7
No modify flag set, skipping filesystem flush and exiting.

Test passed on xfsprogs-4.5.0-20.el7:

# xfs_repair finobt-lv3.img
# xfs_repair -n finobt-lv3.img
Phase 1 - find and verify superblock...
Phase 2 - using internal log
        - zero log...
        - scan filesystem freespace and inode maps...
        - found root inode chunk
Phase 3 - for each AG...
        - scan (but don't clear) agi unlinked lists...
        - process known inodes and perform inode discovery...
        - agno = 0
        - agno = 1
        - agno = 2
        - agno = 3
        - process newly discovered inodes...
Phase 4 - check for duplicate blocks...
        - setting up duplicate extent list...
        - check for inodes claiming duplicate blocks...
        - agno = 0
        - agno = 1
        - agno = 2
        - agno = 3
No modify flag set, skipping phase 5
Phase 6 - check inode connectivity...
        - traversing filesystem ...
        - traversal finished ...
        - moving disconnected inodes to lost+found ...
Phase 7 - verify link counts...
No modify flag set, skipping filesystem flush and exiting.

Comment 7 errata-xmlrpc 2019-08-06 13:06:18 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2019:2216