diff options
author | Chris Mason <chris.mason@oracle.com> | 2008-07-22 11:18:09 -0400 |
---|---|---|
committer | Chris Mason <chris.mason@oracle.com> | 2008-09-25 11:04:05 -0400 |
commit | f421950f86bf96a11fef932e167ab2e70d4c43a0 (patch) | |
tree | a2b62b942b023e37b6aae39891c2b314d8d8a3fb /fs/btrfs/file.c | |
parent | a61e6f29dc7c9d56a776a518eed92bbc61848263 (diff) | |
download | op-kernel-dev-f421950f86bf96a11fef932e167ab2e70d4c43a0.zip op-kernel-dev-f421950f86bf96a11fef932e167ab2e70d4c43a0.tar.gz |
Btrfs: Fix some data=ordered related data corruptions
Stress testing was showing data checksum errors, most of which were caused
by a lookup bug in the extent_map tree. The tree was caching the last
pointer returned, and searches would check the last pointer first.
But, search callers also expect the search to return the very first
matching extent in the range, which wasn't always true with the last
pointer usage.
For now, the code to cache the last return value is just removed. It is
easy to fix, but I think lookups are rare enough that it isn't required anymore.
This commit also replaces do_sync_mapping_range with a local copy of the
related functions.
Signed-off-by: Chris Mason <chris.mason@oracle.com>
Diffstat (limited to 'fs/btrfs/file.c')
-rw-r--r-- | fs/btrfs/file.c | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/fs/btrfs/file.c b/fs/btrfs/file.c index 591a302..e5ffb66 100644 --- a/fs/btrfs/file.c +++ b/fs/btrfs/file.c @@ -381,14 +381,13 @@ int btrfs_drop_extent_cache(struct inode *inode, u64 start, u64 end) break; } if (test_bit(EXTENT_FLAG_PINNED, &em->flags)) { - start = em->start + em->len; - free_extent_map(em); - spin_unlock(&em_tree->lock); - if (start < end) { - len = end - start + 1; - continue; - } - break; + printk(KERN_CRIT "inode %lu trying to drop pinned " + "extent start %llu end %llu, em [%llu %llu]\n", + inode->i_ino, + (unsigned long long)start, + (unsigned long long)end, + (unsigned long long)em->start, + (unsigned long long)em->len); } remove_extent_mapping(em_tree, em); |