• Jan Kara's avatar
    ext4: Fix hole punching for files with indirect blocks · a93cd4cf
    Jan Kara authored
    Hole punching code for files with indirect blocks wrongly computed
    number of blocks which need to be cleared when traversing the indirect
    block tree. That could result in punching more blocks than actually
    requested and thus effectively cause a data loss. For example:
    
    fallocate -n -p 10240000 4096
    
    will punch the range 10240000 - 12632064 instead of the range 1024000 -
    10244096. Fix the calculation.
    
    CC: stable@vger.kernel.org
    Fixes: 8bad6fc8Signed-off-by: default avatarJan Kara <jack@suse.cz>
    Signed-off-by: default avatarTheodore Ts'o <tytso@mit.edu>
    a93cd4cf
indirect.c 40.6 KB