diff options
author | Yan <yanzheng@21cn.com> | 2008-02-15 10:40:50 -0500 |
---|---|---|
committer | Chris Mason <chris.mason@oracle.com> | 2008-09-25 11:04:00 -0400 |
commit | 39b5637f6f195852259004bb27b58e2dcf9fb378 (patch) | |
tree | 64a86c71b34fb16520a1d165b5007d814b1c1c4f | |
parent | 9069218d448ea547dbad5f1cbd537e88d6519d66 (diff) |
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>
-rw-r--r-- | fs/btrfs/extent_io.c | 5 | ||||
-rw-r--r-- | fs/btrfs/file.c | 5 |
2 files changed, 7 insertions, 3 deletions
diff --git a/fs/btrfs/extent_io.c b/fs/btrfs/extent_io.c index fcae999ab712..9262ab37a7cd 100644 --- a/fs/btrfs/extent_io.c +++ b/fs/btrfs/extent_io.c | |||
@@ -2417,12 +2417,13 @@ int try_release_extent_mapping(struct extent_map_tree *map, | |||
2417 | u64 end = start + PAGE_CACHE_SIZE - 1; | 2417 | u64 end = start + PAGE_CACHE_SIZE - 1; |
2418 | u64 orig_start = start; | 2418 | u64 orig_start = start; |
2419 | int ret = 1; | 2419 | int ret = 1; |
2420 | |||
2421 | if ((mask & __GFP_WAIT) && | 2420 | if ((mask & __GFP_WAIT) && |
2422 | page->mapping->host->i_size > 16 * 1024 * 1024) { | 2421 | page->mapping->host->i_size > 16 * 1024 * 1024) { |
2422 | u64 len; | ||
2423 | while (start <= end) { | 2423 | while (start <= end) { |
2424 | len = end - start + 1; | ||
2424 | spin_lock(&map->lock); | 2425 | spin_lock(&map->lock); |
2425 | em = lookup_extent_mapping(map, start, end); | 2426 | em = lookup_extent_mapping(map, start, len); |
2426 | if (!em || IS_ERR(em)) { | 2427 | if (!em || IS_ERR(em)) { |
2427 | spin_unlock(&map->lock); | 2428 | spin_unlock(&map->lock); |
2428 | break; | 2429 | break; |
diff --git a/fs/btrfs/file.c b/fs/btrfs/file.c index f89396082544..b0352b5958a5 100644 --- a/fs/btrfs/file.c +++ b/fs/btrfs/file.c | |||
@@ -357,10 +357,13 @@ int btrfs_drop_extent_cache(struct inode *inode, u64 start, u64 end) | |||
357 | { | 357 | { |
358 | struct extent_map *em; | 358 | struct extent_map *em; |
359 | struct extent_map_tree *em_tree = &BTRFS_I(inode)->extent_tree; | 359 | struct extent_map_tree *em_tree = &BTRFS_I(inode)->extent_tree; |
360 | u64 len = end - start + 1; | ||
360 | 361 | ||
362 | if (end == (u64)-1) | ||
363 | len = (u64)-1; | ||
361 | while(1) { | 364 | while(1) { |
362 | spin_lock(&em_tree->lock); | 365 | spin_lock(&em_tree->lock); |
363 | em = lookup_extent_mapping(em_tree, start, end); | 366 | em = lookup_extent_mapping(em_tree, start, len); |
364 | if (!em) { | 367 | if (!em) { |
365 | spin_unlock(&em_tree->lock); | 368 | spin_unlock(&em_tree->lock); |
366 | break; | 369 | break; |