Btrfs: Use invalidatepage when writepage finds a page outside of i_size

With all the recent fixes to the delalloc locking, it is now safe
again to use invalidatepage inside the writepage code for
pages outside of i_size.  This used to deadlock against some of the
code to write locked ranges of pages, but all of that has been fixed.

Signed-off-by: Chris Mason <chris.mason@oracle.com>
This commit is contained in:
Chris Mason
2008-11-10 11:50:50 -05:00
parent f5a31e1667
commit 39be25cd89
2 changed files with 2 additions and 5 deletions

View File

@@ -2174,11 +2174,7 @@ static int __extent_writepage(struct page *page, struct writeback_control *wbc,
pg_offset = i_size & (PAGE_CACHE_SIZE - 1); pg_offset = i_size & (PAGE_CACHE_SIZE - 1);
if (page->index > end_index || if (page->index > end_index ||
(page->index == end_index && !pg_offset)) { (page->index == end_index && !pg_offset)) {
if (epd->extent_locked) { page->mapping->a_ops->invalidatepage(page, 0);
if (tree->ops && tree->ops->writepage_end_io_hook)
tree->ops->writepage_end_io_hook(page, start,
page_end, NULL, 1);
}
unlock_page(page); unlock_page(page);
return 0; return 0;
} }

View File

@@ -185,6 +185,7 @@ int btrfs_lookup_bio_sums(struct btrfs_root *root, struct inode *inode,
"%llu\n", inode->i_ino, "%llu\n", inode->i_ino,
(unsigned long long)offset); (unsigned long long)offset);
item = NULL; item = NULL;
btrfs_release_path(root, path);
goto found; goto found;
} }
btrfs_item_key_to_cpu(path->nodes[0], &found_key, btrfs_item_key_to_cpu(path->nodes[0], &found_key,