]> git.baikalelectronics.ru Git - kernel.git/commit
Btrfs: clear the extent uptodate bits during parent transid failures
authorChris Mason <chris.mason@oracle.com>
Wed, 22 Feb 2012 17:36:24 +0000 (12:36 -0500)
committerChris Mason <chris.mason@oracle.com>
Thu, 23 Feb 2012 15:43:45 +0000 (10:43 -0500)
commit3ef580ed9d580746b8b8c44b1b28cf233ea96795
tree18549bd9c5724e1517b5497881adc000f21349fc
parent961a5e6e909a34956887f090b828fa21be6e032b
Btrfs: clear the extent uptodate bits during parent transid failures

If btrfs reads a block and finds a parent transid mismatch, it clears
the uptodate flags on the extent buffer, and the pages inside it.  But
we only clear the uptodate bits in the state tree if the block straddles
more than one page.

This is from an old optimization from to reduce contention on the extent
state tree.  But it is buggy because the code that retries a read from
a different copy of the block is going to find the uptodate state bits
set and skip the IO.

The end result of the bug is that we'll never actually read the good
copy (if there is one).

The fix here is to always clear the uptodate state bits, which is safe
because this code is only called when the parent transid fails.

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