Skip to content

Commit 98509cf

Browse files
committed
Btrfs: Fix releasepage to properly keep dirty and writeback pages
Signed-off-by: Chris Mason <[email protected]>
1 parent 8d5bf1c commit 98509cf

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

fs/btrfs/disk-io.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -346,7 +346,7 @@ int btree_readpage_end_io_hook(struct page *page, u64 start, u64 end,
346346
eb = alloc_extent_buffer(tree, start, len, page, GFP_NOFS);
347347

348348
found_start = btrfs_header_bytenr(eb);
349-
if (found_start != start) {
349+
if (0 && found_start != start) {
350350
printk("bad tree block start %llu %llu\n",
351351
(unsigned long long)found_start,
352352
(unsigned long long)eb->start);
@@ -592,6 +592,9 @@ static int btree_releasepage(struct page *page, gfp_t gfp_flags)
592592
struct extent_map_tree *map;
593593
int ret;
594594

595+
if (PageWriteback(page) || PageDirty(page))
596+
return 0;
597+
595598
tree = &BTRFS_I(page->mapping->host)->io_tree;
596599
map = &BTRFS_I(page->mapping->host)->extent_tree;
597600

fs/btrfs/inode.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3060,6 +3060,8 @@ static int __btrfs_releasepage(struct page *page, gfp_t gfp_flags)
30603060

30613061
static int btrfs_releasepage(struct page *page, gfp_t gfp_flags)
30623062
{
3063+
if (PageWriteback(page) || PageDirty(page))
3064+
return 0;
30633065
return __btrfs_releasepage(page, gfp_flags);
30643066
}
30653067

0 commit comments

Comments
 (0)