diff options
author | Chris Mason <chris.mason@oracle.com> | 2008-09-11 15:51:43 -0400 |
---|---|---|
committer | Chris Mason <chris.mason@oracle.com> | 2008-09-25 11:04:07 -0400 |
commit | 98509cfc5a6857bddcfe4b19a9539726655ec9bd (patch) | |
tree | 187cf35f0ebd6c7ce6f17a1d0e3c6b18d0afd85a /fs/btrfs | |
parent | 8d5bf1cb35ea29795862ff0ea2f4c4d7e22727f3 (diff) |
Btrfs: Fix releasepage to properly keep dirty and writeback pages
Signed-off-by: Chris Mason <chris.mason@oracle.com>
Diffstat (limited to 'fs/btrfs')
-rw-r--r-- | fs/btrfs/disk-io.c | 5 | ||||
-rw-r--r-- | fs/btrfs/inode.c | 2 |
2 files changed, 6 insertions, 1 deletions
diff --git a/fs/btrfs/disk-io.c b/fs/btrfs/disk-io.c index 42bf99168056..ecb74b720262 100644 --- a/fs/btrfs/disk-io.c +++ b/fs/btrfs/disk-io.c | |||
@@ -346,7 +346,7 @@ int btree_readpage_end_io_hook(struct page *page, u64 start, u64 end, | |||
346 | eb = alloc_extent_buffer(tree, start, len, page, GFP_NOFS); | 346 | eb = alloc_extent_buffer(tree, start, len, page, GFP_NOFS); |
347 | 347 | ||
348 | found_start = btrfs_header_bytenr(eb); | 348 | found_start = btrfs_header_bytenr(eb); |
349 | if (found_start != start) { | 349 | if (0 && found_start != start) { |
350 | printk("bad tree block start %llu %llu\n", | 350 | printk("bad tree block start %llu %llu\n", |
351 | (unsigned long long)found_start, | 351 | (unsigned long long)found_start, |
352 | (unsigned long long)eb->start); | 352 | (unsigned long long)eb->start); |
@@ -592,6 +592,9 @@ static int btree_releasepage(struct page *page, gfp_t gfp_flags) | |||
592 | struct extent_map_tree *map; | 592 | struct extent_map_tree *map; |
593 | int ret; | 593 | int ret; |
594 | 594 | ||
595 | if (PageWriteback(page) || PageDirty(page)) | ||
596 | return 0; | ||
597 | |||
595 | tree = &BTRFS_I(page->mapping->host)->io_tree; | 598 | tree = &BTRFS_I(page->mapping->host)->io_tree; |
596 | map = &BTRFS_I(page->mapping->host)->extent_tree; | 599 | map = &BTRFS_I(page->mapping->host)->extent_tree; |
597 | 600 | ||
diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c index 073fdd77c784..24b7e97fccb9 100644 --- a/fs/btrfs/inode.c +++ b/fs/btrfs/inode.c | |||
@@ -3060,6 +3060,8 @@ static int __btrfs_releasepage(struct page *page, gfp_t gfp_flags) | |||
3060 | 3060 | ||
3061 | static int btrfs_releasepage(struct page *page, gfp_t gfp_flags) | 3061 | static int btrfs_releasepage(struct page *page, gfp_t gfp_flags) |
3062 | { | 3062 | { |
3063 | if (PageWriteback(page) || PageDirty(page)) | ||
3064 | return 0; | ||
3063 | return __btrfs_releasepage(page, gfp_flags); | 3065 | return __btrfs_releasepage(page, gfp_flags); |
3064 | } | 3066 | } |
3065 | 3067 | ||