• Josef Bacik's avatar
    Btrfs: fix space leak when we fail to make an allocation · 7ed49f18
    Josef Bacik authored
    When changing back to using a spin_lock to protect the extent counters I decided
    that since we would only be dropping our original extent, it was ok to just drop
    the extent and return.  However since somebody else could have come in and done
    a reservation, we need to do the normal song and dance to clear the reservation
    out properly.  So calculate how much space we need to free, and then subtract
    what we just attempted to reserve.  If it's more then we know we need to drop
    those bytes from the delalloc block rsv.  Thanks,
    Signed-off-by: default avatarJosef Bacik <josef@redhat.com>
    7ed49f18
extent-tree.c 196 KB