]> git.baikalelectronics.ru Git - kernel.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)
committerJosef Bacik <josef@redhat.com>
Wed, 19 Oct 2011 19:12:39 +0000 (15:12 -0400)
commit5bf2742f15ce571e39449d0b7de4f4a086df8bc7
tree801cdba60d8cfa7c5aa9ecb2b396ba61d5cad9ab
parentf0f2085188ef5c849e4870ebd93dd7a80dcee3b5
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>
fs/btrfs/extent-tree.c