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.c23
1 files changed, 21 insertions, 2 deletions
diff --git a/fs/xfs/xfs_aops.c b/fs/xfs/xfs_aops.c
index b984647c24db..f5b2453a43b2 100644
--- a/fs/xfs/xfs_aops.c
+++ b/fs/xfs/xfs_aops.c
@@ -434,10 +434,22 @@ xfs_start_page_writeback(
434{ 434{
435 ASSERT(PageLocked(page)); 435 ASSERT(PageLocked(page));
436 ASSERT(!PageWriteback(page)); 436 ASSERT(!PageWriteback(page));
437 if (clear_dirty) 437
438 /*
439 * if the page was not fully cleaned, we need to ensure that the higher
440 * layers come back to it correctly. That means we need to keep the page
441 * dirty, and for WB_SYNC_ALL writeback we need to ensure the
442 * PAGECACHE_TAG_TOWRITE index mark is not removed so another attempt to
443 * write this page in this writeback sweep will be made.
444 */
445 if (clear_dirty) {
438 clear_page_dirty_for_io(page); 446 clear_page_dirty_for_io(page);
439 set_page_writeback(page); 447 set_page_writeback(page);
448 } else
449 set_page_writeback_keepwrite(page);
450
440 unlock_page(page); 451 unlock_page(page);
452
441 /* If no buffers on the page are to be written, finish it here */ 453 /* If no buffers on the page are to be written, finish it here */
442 if (!buffers) 454 if (!buffers)
443 end_page_writeback(page); 455 end_page_writeback(page);
@@ -548,6 +560,13 @@ xfs_cancel_ioend(
548 do { 560 do {
549 next_bh = bh->b_private; 561 next_bh = bh->b_private;
550 clear_buffer_async_write(bh); 562 clear_buffer_async_write(bh);
563 /*
564 * The unwritten flag is cleared when added to the
565 * ioend. We're not submitting for I/O so mark the
566 * buffer unwritten again for next time around.
567 */
568 if (ioend->io_type == XFS_IO_UNWRITTEN)
569 set_buffer_unwritten(bh);
551 unlock_buffer(bh); 570 unlock_buffer(bh);
552 } while ((bh = next_bh) != NULL); 571 } while ((bh = next_bh) != NULL);
553 572