]> git.karo-electronics.de Git - mv-sheeva.git/commit
Btrfs: fix errors handling cached state in set/clear_extent_bit
authorChris Mason <chris.mason@oracle.com>
Wed, 23 Sep 2009 23:51:09 +0000 (19:51 -0400)
committerChris Mason <chris.mason@oracle.com>
Thu, 24 Sep 2009 00:30:52 +0000 (20:30 -0400)
commit42daec299b8b6b9605976d0ee1266b343a31cbcc
tree6813d5d2b30c346413e329f0ad4d6f2262991311
parent7ce618db9878689f87897b673fa3329070860fc7
Btrfs: fix errors handling cached state in set/clear_extent_bit

Both set and clear_extent_bit allow passing a cached
state struct to reduce rbtree search times.  clear_extent_bit
was improperly bypassing some of the checks around making sure
the extent state fields were correct for a given operation.

The fix used here (from Yan Zheng) is to use the hit_next
goto target instead of jumping all the way down to start clearing
bits without making sure the cached state was exactly correct
for the operation we were doing.

This also fixes up the setting of the start variable for both
ops in the case where we find an overlapping extent that
begins before the range we want to change.  In both cases
we were incorrectly going backwards from the original
requested change.

Signed-off-by: Chris Mason <chris.mason@oracle.com>
fs/btrfs/extent_io.c