From: Yan Zheng Date: Wed, 12 Nov 2008 19:19:50 +0000 (-0500) Subject: Btrfs: Fix race in btrfs_mark_extent_written X-Git-Tag: v2.6.29-rc1~27^2~9^2~55^2~15 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c36047d729a3fa080dd194b20b684cc9fe73e90c;p=pandora-kernel.git Btrfs: Fix race in btrfs_mark_extent_written When extent needs to be split, btrfs_mark_extent_written truncates the extent first, then inserts a new extent and increases the reference count. The race happens if someone else deletes the old extent before the new extent is inserted. The fix here is increase the reference count in advance. This race is similar to the race in btrfs_drop_extents that was recently fixed. Signed-off-by: Yan Zheng --- Reading git-diff-tree failed