Skip to content

Commit

Permalink
Btrfs: Add extra checks to avoid removing extent_state from pages we …
Browse files Browse the repository at this point in the history
…can't free

Signed-off-by: Chris Mason <chris.mason@oracle.com>
  • Loading branch information
Chris Mason committed Sep 25, 2008
1 parent f298446 commit 3dd3991
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions fs/btrfs/disk-io.c
Original file line number Diff line number Diff line change
Expand Up @@ -436,6 +436,12 @@ static int btree_releasepage(struct page *page, gfp_t gfp_flags)
struct extent_map_tree *map;
int ret;

if (page_count(page) > 3) {
/* once for page->private, once for the caller, once
* once for the page cache
*/
return 0;
}
tree = &BTRFS_I(page->mapping->host)->io_tree;
map = &BTRFS_I(page->mapping->host)->extent_tree;
ret = try_release_extent_mapping(map, tree, page, gfp_flags);
Expand Down

0 comments on commit 3dd3991

Please sign in to comment.