]> git.ipfire.org Git - people/arne_f/kernel.git/commit
Btrfs: only do the tree_mod_log_free_eb if this is our last ref
authorJosef Bacik <jbacik@fusionio.com>
Mon, 1 Jul 2013 20:10:16 +0000 (16:10 -0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 21 Jul 2013 00:16:08 +0000 (17:16 -0700)
commitda94067deee6e073129061575d1a3e437232a6c5
tree66727efa9a9fdd10affb070ab8364dec6f4d9877
parent83bcee5c1c067de22f4830382cbe9483f01ffeaf
Btrfs: only do the tree_mod_log_free_eb if this is our last ref

commit 7fb7d76f96bfcbea25007d190ba828b18e13d29d upstream.

There is another bug in the tree mod log stuff in that we're calling
tree_mod_log_free_eb every single time a block is cow'ed.  The problem with this
is that if this block is shared by multiple snapshots we will call this multiple
times per block, so if we go to rewind the mod log for this block we'll BUG_ON()
in __tree_mod_log_rewind because we try to rewind a free twice.  We only want to
call tree_mod_log_free_eb if we are actually freeing the block.  With this patch
I no longer hit the panic in __tree_mod_log_rewind.  Thanks,

Reviewed-by: Jan Schmidt <list.btrfs@jan-o-sch.net>
Signed-off-by: Josef Bacik <jbacik@fusionio.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
fs/btrfs/ctree.c