]> rtime.felk.cvut.cz Git - linux-imx.git/commit
Btrfs: fix error handling in make/read block group
authorJosef Bacik <jbacik@fusionio.com>
Tue, 2 Apr 2013 16:40:42 +0000 (12:40 -0400)
committerJosef Bacik <jbacik@fusionio.com>
Mon, 6 May 2013 19:54:32 +0000 (15:54 -0400)
commit8c579fe745d96d0841c28295c10ac3e427cef9f2
treea857b4aee9d38f88fcf54ef38859771333ed3bb3
parent5c2d867fdcbc11a6862379ebd60b2c1a66e13671
Btrfs: fix error handling in make/read block group

I noticed that we will add a block group to the space info before we add it to
the block group cache rb tree, so we could potentially allocate from the block
group before it's able to be searched for.  I don't think this is too much of
a problem, the race window is microscopic, but just in case move the tree
insertion to above the space info linking.  This makes it easier to adjust the
error handling as well, so we can remove a couple of BUG_ON(ret)'s and have real
error handling setup for these scenarios.  Thanks,

Signed-off-by: Josef Bacik <jbacik@fusionio.com>
fs/btrfs/extent-tree.c