diff options
-rw-r--r-- | fs/ext3/inode.c | 23 |
1 files changed, 18 insertions, 5 deletions
diff --git a/fs/ext3/inode.c b/fs/ext3/inode.c index 466a332e0bd1..fcfa24361856 100644 --- a/fs/ext3/inode.c +++ b/fs/ext3/inode.c | |||
@@ -1521,12 +1521,16 @@ static int ext3_ordered_writepage(struct page *page, | |||
1521 | if (!page_has_buffers(page)) { | 1521 | if (!page_has_buffers(page)) { |
1522 | create_empty_buffers(page, inode->i_sb->s_blocksize, | 1522 | create_empty_buffers(page, inode->i_sb->s_blocksize, |
1523 | (1 << BH_Dirty)|(1 << BH_Uptodate)); | 1523 | (1 << BH_Dirty)|(1 << BH_Uptodate)); |
1524 | } else if (!walk_page_buffers(NULL, page_buffers(page), 0, PAGE_CACHE_SIZE, NULL, buffer_unmapped)) { | 1524 | page_bufs = page_buffers(page); |
1525 | /* Provide NULL instead of get_block so that we catch bugs if buffers weren't really mapped */ | 1525 | } else { |
1526 | return block_write_full_page(page, NULL, wbc); | 1526 | page_bufs = page_buffers(page); |
1527 | if (!walk_page_buffers(NULL, page_bufs, 0, PAGE_CACHE_SIZE, | ||
1528 | NULL, buffer_unmapped)) { | ||
1529 | /* Provide NULL get_block() to catch bugs if buffers | ||
1530 | * weren't really mapped */ | ||
1531 | return block_write_full_page(page, NULL, wbc); | ||
1532 | } | ||
1527 | } | 1533 | } |
1528 | page_bufs = page_buffers(page); | ||
1529 | |||
1530 | handle = ext3_journal_start(inode, ext3_writepage_trans_blocks(inode)); | 1534 | handle = ext3_journal_start(inode, ext3_writepage_trans_blocks(inode)); |
1531 | 1535 | ||
1532 | if (IS_ERR(handle)) { | 1536 | if (IS_ERR(handle)) { |
@@ -1581,6 +1585,15 @@ static int ext3_writeback_writepage(struct page *page, | |||
1581 | if (ext3_journal_current_handle()) | 1585 | if (ext3_journal_current_handle()) |
1582 | goto out_fail; | 1586 | goto out_fail; |
1583 | 1587 | ||
1588 | if (page_has_buffers(page)) { | ||
1589 | if (!walk_page_buffers(NULL, page_buffers(page), 0, | ||
1590 | PAGE_CACHE_SIZE, NULL, buffer_unmapped)) { | ||
1591 | /* Provide NULL get_block() to catch bugs if buffers | ||
1592 | * weren't really mapped */ | ||
1593 | return block_write_full_page(page, NULL, wbc); | ||
1594 | } | ||
1595 | } | ||
1596 | |||
1584 | handle = ext3_journal_start(inode, ext3_writepage_trans_blocks(inode)); | 1597 | handle = ext3_journal_start(inode, ext3_writepage_trans_blocks(inode)); |
1585 | if (IS_ERR(handle)) { | 1598 | if (IS_ERR(handle)) { |
1586 | ret = PTR_ERR(handle); | 1599 | ret = PTR_ERR(handle); |