• Stephen Warren's avatar
    fs: ext4: fix writing zero-length files · d0180280
    Stephen Warren authored
    ext4fs_allocate_blocks() always allocates at least one block for a file.
    If the file size is zero, this causes total_remaining_blocks to
    underflow, which then causes an apparent hang while 2^32 blocks are
    allocated.
    
    To solve this, check that total_remaining_blocks is non-zero as part of
    the loop condition (i.e. before each loop) rather than at the end of
    the loop.
    Signed-off-by: default avatarStephen Warren <swarren@nvidia.com>
    d0180280
Name
Last commit
Last update
..
cbfs Loading commit data...
cramfs Loading commit data...
ext4 Loading commit data...
fat Loading commit data...
jffs2 Loading commit data...
reiserfs Loading commit data...
sandbox Loading commit data...
ubifs Loading commit data...
yaffs2 Loading commit data...
zfs Loading commit data...
Makefile Loading commit data...
fs.c Loading commit data...