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 667762

Summary: ext4: dbench corrupts inode bitmaps
Product: Red Hat Enterprise Linux 5 Reporter: Eric Sandeen <esandeen>
Component: kernelAssignee: Eric Sandeen <esandeen>
Status: CLOSED DUPLICATE QA Contact: Filesystem QE <fs-qe>
Severity: high Docs Contact:
Priority: high    
Version: 5.6CC: eguan, kzhang, qcai, rwheeler
Target Milestone: rc   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2011-02-03 17:58:44 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 Eric Sandeen 2011-01-06 17:51:04 UTC
This is more or less a clone of bug #623666 fs corruption with xfstests for ext4

The same problem exists on the rhel5 backport, but it wasn't caught because the xfstests test (241) wasn't running dbench long enough to hit it reliably.

The fix is the same:

diff --git a/fs/ext4/ialloc.c b/fs/ext4/ialloc.c
index 22b59c8..b71c331 100644
--- a/fs/ext4/ialloc.c
+++ b/fs/ext4/ialloc.c
@@ -242,8 +242,9 @@ void ext4_free_inode(handle_t *handle, struct inode *inode)
                goto error_return;
 
        /* Ok, now we can actually update the inode bitmaps.. */
-       cleared = ext4_clear_bit_atomic(ext4_group_lock_ptr(sb, block_group),
-                                       bit, bitmap_bh->b_data);
+       ext4_lock_group(sb, block_group);
+       cleared = ext4_clear_bit(bit, bitmap_bh->b_data);
+       ext4_unlock_group(sb, block_group);
        if (!cleared)
                ext4_error(sb, "bit already cleared for inode %lu", ino);
        else {

Comment 1 Eric Sandeen 2011-01-06 17:54:59 UTC
The end result of the big is inode bitmap corruption/mismatches:

e4fsck 1.41.12 (17-May-2010)
Pass 1: Checking inodes, blocks, and sizes
Pass 2: Checking directory structure
Pass 3: Checking directory connectivity
Pass 4: Checking reference counts
Pass 5: Checking group summary information
!./Inode bitmap differences:  -1700621 -1700633 -1700743 -1700880 -1700886 -1700895 -1700914 -1700917 -1700922 -1700934 -1700940 -1700944 -1700948 -1700954 -1700956 -1700958 -1700971 -1700980 -1700986 -1700998 -1701005
Fix? yes

Comment 2 RHEL Program Management 2011-01-06 18:10:08 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 3 Eric Sandeen 2011-01-06 18:33:07 UTC
Setting for 5.7 since we want to propose this for zstream.  This is filesystem corruption.

Comment 4 Eric Sandeen 2011-02-03 17:58:44 UTC

*** This bug has been marked as a duplicate of bug 663563 ***