Commit 39be25cd89450940b0e5f8a6aad71d1ec99b17bf

Authored by Chris Mason
1 parent f5a31e1667

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>

Showing 2 changed files with 2 additions and 5 deletions Side-by-side Diff

fs/btrfs/extent_io.c
... ... @@ -2174,11 +2174,7 @@
2174 2174 pg_offset = i_size & (PAGE_CACHE_SIZE - 1);
2175 2175 if (page->index > end_index ||
2176 2176 (page->index == end_index && !pg_offset)) {
2177   - if (epd->extent_locked) {
2178   - if (tree->ops && tree->ops->writepage_end_io_hook)
2179   - tree->ops->writepage_end_io_hook(page, start,
2180   - page_end, NULL, 1);
2181   - }
  2177 + page->mapping->a_ops->invalidatepage(page, 0);
2182 2178 unlock_page(page);
2183 2179 return 0;
2184 2180 }
fs/btrfs/file-item.c
... ... @@ -185,6 +185,7 @@
185 185 "%llu\n", inode->i_ino,
186 186 (unsigned long long)offset);
187 187 item = NULL;
  188 + btrfs_release_path(root, path);
188 189 goto found;
189 190 }
190 191 btrfs_item_key_to_cpu(path->nodes[0], &found_key,