• Josef Bacik's avatar
    btrfs: always reserve our entire size for the global reserve · d792b0f1
    Josef Bacik authored
    While messing with the overcommit logic I noticed that sometimes we'd
    ENOSPC out when really we should have run out of space much earlier.  It
    turns out it's because we'll only reserve up to the free amount left in
    the space info for the global reserve, but that doesn't make sense with
    overcommit because we could be well above our actual size.  This results
    in the global reserve not carving out it's entire reservation, and thus
    not putting enough pressure on the rest of the infrastructure to do the
    right thing and ENOSPC out at a convenient time.  Fix this by always
    taking our full reservation amount for the global reserve.
    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>
    d792b0f1
block-rsv.c 11.7 KB