Skip to content
Commit 7ed49f18 authored by Josef Bacik's avatar Josef Bacik
Browse files

Btrfs: fix space leak when we fail to make an allocation



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>
parent a9b5fcdd
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment