]> git.karo-electronics.de Git - karo-tx-linux.git/commit
Btrfs: change how we calculate the global block rsv
authorJosef Bacik <jbacik@fb.com>
Fri, 27 May 2016 16:58:35 +0000 (12:58 -0400)
committerDavid Sterba <dsterba@suse.com>
Thu, 7 Jul 2016 16:45:53 +0000 (18:45 +0200)
commitae2e4728816510ae4e8ed2b732b34ea0aba05a34
treea420e171bc10700c7863b459919c767bcdc2f9a9
parent87241c2e68451c4d50b60af84f9a3ab119001b4c
Btrfs: change how we calculate the global block rsv

Traditionally we've calculated the global block rsv by guessing how much of the
metadata used amount was the extent tree, and then taking the data size and
figuring out how large the csum tree would have to be to hold that much data.

This is imprecise and falls down on MIXED file systems as we can't trust the
data used amount.  This resulted in failures for xfstests generic/333 because it
creates lots of clones, which explodes out the extent tree.  Our global reserve
calculations were woefully inaccurate in this case which meant we got into a
situation where we did not have enough reserved to do our work.

We know we only use the global block rsv for the extent, csum, and root trees,
so just get the bytes used for these trees and use that as the basis of our
global reserve.  Since these are not reference counted trees the bytes_used
value will be accurate.  This fixed the transaction aborts seen with
generic/333.  Thanks,

Signed-off-by: Josef Bacik <jbacik@fb.com>
Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/extent-tree.c