• Aneesh Kumar K.V's avatar
    ext4: Drop EXT4_GET_BLOCKS_UPDATE_RESERVE_SPACE flag · 6595162b
    Aneesh Kumar K.V authored
    commit 1296cc85 upstream (as of v2.6.33-rc6)
    
    We should update reserve space if it is delalloc buffer
    and that is indicated by EXT4_GET_BLOCKS_DELALLOC_RESERVE flag.
    So use EXT4_GET_BLOCKS_DELALLOC_RESERVE in place of
    EXT4_GET_BLOCKS_UPDATE_RESERVE_SPACE
    
    [ Stable note: This fixes a corruption cuased by the following
      reproduction case:
    
      rm -f $TEST_FN
      touch $TEST_FN
      fallocate -n -o 656712 -l 858907 $TEST_FN
      dd if=/dev/zero of=$TEST_FN conv=notrunc bs=1 seek=1011020 count=36983
      sync
      dd if=/dev/zero of=$TEST_FN conv=notrunc bs=1 seek=332121 count=24005
      dd if=/dev/zero of=$TEST_FN conv=notrunc bs=1 seek=1040179 count=93319
    
      If the filesystem is then unmounted and e2fsck run forced, the
      i_blocks field for the file $TEST_FN will be found to be incorrect. ]
    Signed-off-by: default avatarAneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
    Signed-off-by: default avatar"Theodore Ts'o" <tytso@mit.edu>
    Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
    6595162b
inode.c 170 KB