diff options
Diffstat (limited to 'fs/ext4/extents.c')
-rw-r--r-- | fs/ext4/extents.c | 15 |
1 files changed, 4 insertions, 11 deletions
diff --git a/fs/ext4/extents.c b/fs/ext4/extents.c index bb36a28f8ff3..b722bce7d662 100644 --- a/fs/ext4/extents.c +++ b/fs/ext4/extents.c | |||
@@ -2749,7 +2749,7 @@ out2: | |||
2749 | return err ? err : allocated; | 2749 | return err ? err : allocated; |
2750 | } | 2750 | } |
2751 | 2751 | ||
2752 | void ext4_ext_truncate(struct inode * inode, struct page *page) | 2752 | void ext4_ext_truncate(struct inode *inode) |
2753 | { | 2753 | { |
2754 | struct address_space *mapping = inode->i_mapping; | 2754 | struct address_space *mapping = inode->i_mapping; |
2755 | struct super_block *sb = inode->i_sb; | 2755 | struct super_block *sb = inode->i_sb; |
@@ -2762,18 +2762,11 @@ void ext4_ext_truncate(struct inode * inode, struct page *page) | |||
2762 | */ | 2762 | */ |
2763 | err = ext4_writepage_trans_blocks(inode) + 3; | 2763 | err = ext4_writepage_trans_blocks(inode) + 3; |
2764 | handle = ext4_journal_start(inode, err); | 2764 | handle = ext4_journal_start(inode, err); |
2765 | if (IS_ERR(handle)) { | 2765 | if (IS_ERR(handle)) |
2766 | if (page) { | ||
2767 | clear_highpage(page); | ||
2768 | flush_dcache_page(page); | ||
2769 | unlock_page(page); | ||
2770 | page_cache_release(page); | ||
2771 | } | ||
2772 | return; | 2766 | return; |
2773 | } | ||
2774 | 2767 | ||
2775 | if (page) | 2768 | if (inode->i_size & (sb->s_blocksize - 1)) |
2776 | ext4_block_truncate_page(handle, page, mapping, inode->i_size); | 2769 | ext4_block_truncate_page(handle, mapping, inode->i_size); |
2777 | 2770 | ||
2778 | down_write(&EXT4_I(inode)->i_data_sem); | 2771 | down_write(&EXT4_I(inode)->i_data_sem); |
2779 | ext4_ext_invalidate_cache(inode); | 2772 | ext4_ext_invalidate_cache(inode); |