• Josef Bacik's avatar
    Btrfs: fix outstanding_extents accounting in DIO · e1cbbfa5
    Josef Bacik authored
    We are keeping track of how many extents we need to reserve properly based on
    the amount we want to write, but we were still incrementing outstanding_extents
    if we wrote less than what we requested.  This isn't quite right since we will
    be limited to our max extent size.  So instead lets do something horrible!  Keep
    track of how many outstanding_extents we reserved, and decrement each time we
    allocate an extent.  If we use our entire reserve make sure to jack up
    outstanding_extents on the inode so the accounting works out properly.  Thanks,
    Reported-by: default avatarFilipe Manana <fdmanana@suse.com>
    Signed-off-by: default avatarJosef Bacik <jbacik@fb.com>
    e1cbbfa5
inode.c 256 KB