]> www.infradead.org Git - users/jedix/linux-maple.git/commit
Btrfs: fix space leak when we fail to make an allocation
authorJosef Bacik <josef@redhat.com>
Fri, 19 Aug 2011 19:45:52 +0000 (15:45 -0400)
committerChris Mason <chris.mason@oracle.com>
Wed, 16 Nov 2011 02:20:18 +0000 (21:20 -0500)
commite0069469b7dd370c0e892df84890124f50ef8a87
tree0cb5786597d0dca48456f6f0f3398674ddef7cd4
parentb0cf99d537dcdcd3ff9aadd6e36a443e7563a61e
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: Josef Bacik <josef@redhat.com>
(cherry picked from commit 7ed49f187c82821e35f8869399bcf90822a74a23)
fs/btrfs/extent-tree.c