]> 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)
commit8942f76d3a2a9389ac1fe34ea1da1a1b71214251
tree801cdba60d8cfa7c5aa9ecb2b396ba61d5cad9ab
parent91e6505a8644687d5cc5830439a897956e195edd
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