mirror of
https://github.com/adulau/aha.git
synced 2025-01-01 05:36:24 +00:00
Btrfs: Add extra checks to avoid removing extent_state from pages we can't free
Signed-off-by: Chris Mason <chris.mason@oracle.com>
This commit is contained in:
parent
f29844623d
commit
3dd39914bc
1 changed files with 6 additions and 0 deletions
|
@ -436,6 +436,12 @@ static int btree_releasepage(struct page *page, gfp_t gfp_flags)
|
||||||
struct extent_map_tree *map;
|
struct extent_map_tree *map;
|
||||||
int ret;
|
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;
|
tree = &BTRFS_I(page->mapping->host)->io_tree;
|
||||||
map = &BTRFS_I(page->mapping->host)->extent_tree;
|
map = &BTRFS_I(page->mapping->host)->extent_tree;
|
||||||
ret = try_release_extent_mapping(map, tree, page, gfp_flags);
|
ret = try_release_extent_mapping(map, tree, page, gfp_flags);
|
||||||
|
|
Loading…
Reference in a new issue