Bug 1448019

Summary: e2fsprogs: fail to open 1k block size ext4 with bigalloc,meta_bg,^resize_inode
Product: Red Hat Enterprise Linux 7 Reporter: Eryu Guan <eguan>
Component: e2fsprogsAssignee: Lukáš Czerner <lczerner>
Status: CLOSED ERRATA QA Contact: Boyang Xue <bxue>
Severity: low Docs Contact:
Priority: low    
Version: 7.4CC: xzhou
Target Milestone: rc   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: e2fsprogs-1.42.9-13.el7 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2018-10-30 11:38:55 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Eryu Guan 2017-05-04 11:44:49 UTC
Description of problem:
fstests ext4/025 fails due to debugfs fails to open the newly created ext4 when testing with 1k block size config.

# mkfs -t ext4 -b 1024 -O bigalloc,meta_bg,^resize_inode -F /dev/vda6
# debugfs /dev/vda6
debugfs 1.42.9 (28-Dec-2013)
/dev/vda6: Can't read an inode bitmap while reading inode bitmap
# e2fsck -nf /dev/vda6
<corruption message floods>

Seems we need this patch:

commit d36b957b345ee6e4b529be99b8fdc8d3e70ccdc1
Author: Darrick J. Wong <darrick.wong>
Date:   Sat Jan 11 13:58:15 2014 -0500

    libext2fs: don't always read backup group descriptors on a 1k-block meta_bg fs
    
    On a filesystem with 1K blocks and meta_bg enabled, opening a
    filesystem with automatic superblock detection tries to compensate for
    the fact that the superblock lives in block 1.  However, the method by
    which this is done is later misinterpreted to mean "read the backup
    group descriptors", which is not what we want in this case.
    
    Therefore, in ext2fs_open3() separate the 'group zero' adjustment into
    its own variable so that we don't get fed backup group descriptors
    when we try to load meta_bg group descriptors.
    
    Furthermore, enhance ext2fs_descriptor_block_loc2() to perform its own
    group zero correction.  The other caller of this function neglects to
    do any group-zero correction of their own, so this fixes them too.
    
    Signed-off-by: Darrick J. Wong <darrick.wong>
    Signed-off-by: Theodore Ts'o <tytso>

Version-Release number of selected component (if applicable):
e2fsprogs-1.42.9-9.el7

How reproducible:
always

Steps to Reproduce:
1. see description
2.
3.

Actual results:
debugfs fails to open newly created ext4
e2fsck floods console with error messages

Expected results:
open such ext4 fs correctly by debugfs and no corruption found by e2fsck

Additional info:
I set severity to low because it seems bigalloc feature is required to reproduce, and we don't support ext4 with bigalloc feature, and we only see this failure in testing, so file a bug anyway to track the fstests failure.

Please feel free to close if it's not worth fixing.

Comment 7 errata-xmlrpc 2018-10-30 11:38:55 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-2018:3276