diff options
author | Chris Mason <chris.mason@oracle.com> | 2008-04-11 10:51:07 -0400 |
---|---|---|
committer | Chris Mason <chris.mason@oracle.com> | 2008-09-25 11:04:01 -0400 |
commit | 3dd39914bc0737d055c780d29c20a1d117819cdb (patch) | |
tree | d7d65e3f3d929310130316051d16e5c52906283b | |
parent | f29844623de29a12358d7fba35d0959465b64adf (diff) |
Btrfs: Add extra checks to avoid removing extent_state from pages we can't free
Signed-off-by: Chris Mason <chris.mason@oracle.com>
-rw-r--r-- | fs/btrfs/disk-io.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/fs/btrfs/disk-io.c b/fs/btrfs/disk-io.c index cf1de75f088a..e22960e23501 100644 --- a/fs/btrfs/disk-io.c +++ b/fs/btrfs/disk-io.c | |||
@@ -436,6 +436,12 @@ static int btree_releasepage(struct page *page, gfp_t gfp_flags) | |||
436 | struct extent_map_tree *map; | 436 | struct extent_map_tree *map; |
437 | int ret; | 437 | int ret; |
438 | 438 | ||
439 | if (page_count(page) > 3) { | ||
440 | /* once for page->private, once for the caller, once | ||
441 | * once for the page cache | ||
442 | */ | ||
443 | return 0; | ||
444 | } | ||
439 | tree = &BTRFS_I(page->mapping->host)->io_tree; | 445 | tree = &BTRFS_I(page->mapping->host)->io_tree; |
440 | map = &BTRFS_I(page->mapping->host)->extent_tree; | 446 | map = &BTRFS_I(page->mapping->host)->extent_tree; |
441 | ret = try_release_extent_mapping(map, tree, page, gfp_flags); | 447 | ret = try_release_extent_mapping(map, tree, page, gfp_flags); |