From: Josef Bacik Date: Fri, 9 Mar 2012 14:51:43 +0000 (-0500) Subject: Btrfs: only use the existing eb if it's count isn't 0 X-Git-Tag: v3.4-rc1~22^2~25 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=115391d2315239164e400a8259b26392afccf3bd;p=pandora-kernel.git Btrfs: only use the existing eb if it's count isn't 0 We can run into a problem where we find an eb for our existing page already on the radix tree but it has a ref count of 0. It hasn't yet been removed by RCU yet so this can cause issues where we will use the EB after free. So do atomic_inc_not_zero on the exists->refs and if it is zero just do synchronize_rcu() and try again. We won't have to worry about new allocators coming in since they will block on the page lock at this point. Thanks, Signed-off-by: Josef Bacik --- Reading git-diff-tree failed