aboutsummaryrefslogtreecommitdiffstats
path: root/fs/xfs/xfs_aops.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/xfs/xfs_aops.c')
-rw-r--r--fs/xfs/xfs_aops.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/fs/xfs/xfs_aops.c b/fs/xfs/xfs_aops.c
index 2b2691b73428..41a695048be7 100644
--- a/fs/xfs/xfs_aops.c
+++ b/fs/xfs/xfs_aops.c
@@ -725,6 +725,25 @@ xfs_convert_page(
725 (xfs_off_t)(page->index + 1) << PAGE_CACHE_SHIFT, 725 (xfs_off_t)(page->index + 1) << PAGE_CACHE_SHIFT,
726 i_size_read(inode)); 726 i_size_read(inode));
727 727
728 /*
729 * If the current map does not span the entire page we are about to try
730 * to write, then give up. The only way we can write a page that spans
731 * multiple mappings in a single writeback iteration is via the
732 * xfs_vm_writepage() function. Data integrity writeback requires the
733 * entire page to be written in a single attempt, otherwise the part of
734 * the page we don't write here doesn't get written as part of the data
735 * integrity sync.
736 *
737 * For normal writeback, we also don't attempt to write partial pages
738 * here as it simply means that write_cache_pages() will see it under
739 * writeback and ignore the page until some point in the future, at
740 * which time this will be the only page in the file that needs
741 * writeback. Hence for more optimal IO patterns, we should always
742 * avoid partial page writeback due to multiple mappings on a page here.
743 */
744 if (!xfs_imap_valid(inode, imap, end_offset))
745 goto fail_unlock_page;
746
728 len = 1 << inode->i_blkbits; 747 len = 1 << inode->i_blkbits;
729 p_offset = min_t(unsigned long, end_offset & (PAGE_CACHE_SIZE - 1), 748 p_offset = min_t(unsigned long, end_offset & (PAGE_CACHE_SIZE - 1),
730 PAGE_CACHE_SIZE); 749 PAGE_CACHE_SIZE);