]> www.infradead.org Git - users/jedix/linux-maple.git/commit
Btrfs: don't increase the block_rsv's size when emergency allocating space
authorJosef Bacik <josef@redhat.com>
Mon, 22 Aug 2011 19:23:19 +0000 (15:23 -0400)
committerChris Mason <chris.mason@oracle.com>
Wed, 16 Nov 2011 02:20:18 +0000 (21:20 -0500)
commitb5dc65ca86b1bae469dc56f6451d58ccd570237f
tree128005057b47edde8a0c4da9053e3c4ec7f2b807
parente0069469b7dd370c0e892df84890124f50ef8a87
Btrfs: don't increase the block_rsv's size when emergency allocating space

If we have to emergency reserve space we need to not increase the block_rsv
size, otherwise we'll leak space.  Take for instance delalloc, say we reserve
4k, and we use that 4k, and then we have to emergency allocate another 4k, we
bump the size up to 8k, however we've only accounted for 4k in reservations in
all of our supporting logic, so we'll go to free the 4k and end up having a size
of 4k, which will cause us to later not free as much space.  I saw this doing
testing where I wasn't reserving enough space for something but was still
leaking space, very frustrating.  Thanks,

Signed-off-by: Josef Bacik <josef@redhat.com>
(cherry picked from commit 7f70150896ebd1169d9c43484c8c424f755353c4)
fs/btrfs/extent-tree.c