Btrfs: Fix "no csum found for inode" issue.

A few codes were not properly updated for changes of extent map.  This
may be the causes of "no csum found for inode" issue.

Signed-off-by: Chris Mason <chris.mason@oracle.com>
This commit is contained in:
Yan
2008-02-15 10:40:50 -05:00
committed by Chris Mason
parent 9069218d44
commit 39b5637f6f
2 changed files with 7 additions and 3 deletions

View File

@@ -357,10 +357,13 @@ int btrfs_drop_extent_cache(struct inode *inode, u64 start, u64 end)
{
struct extent_map *em;
struct extent_map_tree *em_tree = &BTRFS_I(inode)->extent_tree;
u64 len = end - start + 1;
if (end == (u64)-1)
len = (u64)-1;
while(1) {
spin_lock(&em_tree->lock);
em = lookup_extent_mapping(em_tree, start, end);
em = lookup_extent_mapping(em_tree, start, len);
if (!em) {
spin_unlock(&em_tree->lock);
break;