• Eric Whitney's avatar
    ext4: fix bigalloc cluster freeing when hole punching under load · dee200ab
    Eric Whitney authored
    [ Upstream commit 7bd75230 ]
    
    Ext4 may not free clusters correctly when punching holes in bigalloc
    file systems under high load conditions.  If it's not possible to
    extend and restart the journal in ext4_ext_rm_leaf() when preparing to
    remove blocks from a punched region, a retry of the entire punch
    operation is triggered in ext4_ext_remove_space().  This causes a
    partial cluster to be set to the first cluster in the extent found to
    the right of the punched region.  However, if the punch operation
    prior to the retry had made enough progress to delete one or more
    extents and a partial cluster candidate for freeing had already been
    recorded, the retry would overwrite the partial cluster.  The loss of
    this information makes it impossible to correctly free the original
    partial cluster in all cases.
    
    This bug can cause generic/476 to fail when run as part of
    xfstests-bld's bigalloc and bigalloc_1k test cases.  The failure is
    reported when e2fsck detects bad iblocks counts greater than expected
    in units of whole clusters and also detects a number of negative block
    bitmap differences equal to the iblocks discrepancy in cluster units.
    Signed-off-by: 's avatarEric Whitney <enwlinux@gmail.com>
    Signed-off-by: Theodore Ts'o's avatarTheodore Ts'o <tytso@mit.edu>
    Signed-off-by: 's avatarSasha Levin <sashal@kernel.org>
    dee200ab
Name
Last commit
Last update
..
Kconfig Loading commit data...
Makefile Loading commit data...
acl.c Loading commit data...
acl.h Loading commit data...
balloc.c Loading commit data...
bitmap.c Loading commit data...
block_validity.c Loading commit data...
dir.c Loading commit data...
ext4.h Loading commit data...
ext4_extents.h Loading commit data...
ext4_jbd2.c Loading commit data...
ext4_jbd2.h Loading commit data...
extents.c Loading commit data...
extents_status.c Loading commit data...
extents_status.h Loading commit data...
file.c Loading commit data...
fsmap.c Loading commit data...
fsmap.h Loading commit data...
fsync.c Loading commit data...
hash.c Loading commit data...
ialloc.c Loading commit data...
indirect.c Loading commit data...
inline.c Loading commit data...
inode.c Loading commit data...
ioctl.c Loading commit data...
mballoc.c Loading commit data...
mballoc.h Loading commit data...
migrate.c Loading commit data...
mmp.c Loading commit data...
move_extent.c Loading commit data...
namei.c Loading commit data...
page-io.c Loading commit data...
readpage.c Loading commit data...
resize.c Loading commit data...
super.c Loading commit data...
symlink.c Loading commit data...
sysfs.c Loading commit data...
truncate.h Loading commit data...
xattr.c Loading commit data...
xattr.h Loading commit data...
xattr_security.c Loading commit data...
xattr_trusted.c Loading commit data...
xattr_user.c Loading commit data...