• Josef Bacik's avatar
    btrfs: don't enospc all tickets on flush failure · f91587e4
    Josef Bacik authored
    With the introduction of the per-inode block_rsv it became possible to
    have really really large reservation requests made because of data
    fragmentation.  Since the ticket stuff assumed that we'd always have
    relatively small reservation requests it just killed all tickets if we
    were unable to satisfy the current request.
    
    However, this is generally not the case anymore.  So fix this logic to
    instead see if we had a ticket that we were able to give some
    reservation to, and if we were continue the flushing loop again.
    
    Likewise we make the tickets use the space_info_add_old_bytes() method
    of returning what reservation they did receive in hopes that it could
    satisfy reservations down the line.
    Reviewed-by: default avatarNikolay Borisov <nborisov@suse.com>
    Signed-off-by: default avatarJosef Bacik <josef@toxicpanda.com>
    Signed-off-by: default avatarDavid Sterba <dsterba@suse.com>
    f91587e4
extent-tree.c 314 KB