Skip to content

Commit

Permalink
Btrfs: Fix "no csum found for inode" issue.
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Yan authored and Chris Mason committed Sep 25, 2008
1 parent 9069218 commit 39b5637
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
5 changes: 3 additions & 2 deletions fs/btrfs/extent_io.c
Original file line number Diff line number Diff line change
Expand Up @@ -2417,12 +2417,13 @@ int try_release_extent_mapping(struct extent_map_tree *map,
u64 end = start + PAGE_CACHE_SIZE - 1;
u64 orig_start = start;
int ret = 1;

if ((mask & __GFP_WAIT) &&
page->mapping->host->i_size > 16 * 1024 * 1024) {
u64 len;
while (start <= end) {
len = end - start + 1;
spin_lock(&map->lock);
em = lookup_extent_mapping(map, start, end);
em = lookup_extent_mapping(map, start, len);
if (!em || IS_ERR(em)) {
spin_unlock(&map->lock);
break;
Expand Down
5 changes: 4 additions & 1 deletion fs/btrfs/file.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 39b5637

Please sign in to comment.