• Josef Bacik's avatar
    btrfs: use btrfs_try_granting_tickets in update_global_rsv · 426551f6
    Josef Bacik authored
    We have some annoying xfstests tests that will create a very small fs,
    fill it up, delete it, and repeat to make sure everything works right.
    This trips btrfs up sometimes because we may commit a transaction to
    free space, but most of the free metadata space was being reserved by
    the global reserve.  So we commit and update the global reserve, but the
    space is simply added to bytes_may_use directly, instead of trying to
    add it to existing tickets.  This results in ENOSPC when we really did
    have space.  Fix this by calling btrfs_try_granting_tickets once we add
    back our excess space to wake any pending tickets.
    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>
    426551f6
block-rsv.c 11.8 KB