diff options
Diffstat (limited to 'fs/ocfs2')
-rw-r--r-- | fs/ocfs2/alloc.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/fs/ocfs2/alloc.c b/fs/ocfs2/alloc.c index 98694a1add43..027cf5d05ffb 100644 --- a/fs/ocfs2/alloc.c +++ b/fs/ocfs2/alloc.c | |||
@@ -3517,6 +3517,7 @@ int ocfs2_zero_tail_for_truncate(struct inode *inode, handle_t *handle, | |||
3517 | u64 new_i_size) | 3517 | u64 new_i_size) |
3518 | { | 3518 | { |
3519 | int ret, numpages; | 3519 | int ret, numpages; |
3520 | loff_t endbyte; | ||
3520 | struct page **pages = NULL; | 3521 | struct page **pages = NULL; |
3521 | u64 phys; | 3522 | u64 phys; |
3522 | 3523 | ||
@@ -3555,7 +3556,9 @@ int ocfs2_zero_tail_for_truncate(struct inode *inode, handle_t *handle, | |||
3555 | * wait on them - the truncate_inode_pages() call later will | 3556 | * wait on them - the truncate_inode_pages() call later will |
3556 | * do that for us. | 3557 | * do that for us. |
3557 | */ | 3558 | */ |
3558 | ret = filemap_fdatawrite(inode->i_mapping); | 3559 | endbyte = ocfs2_align_bytes_to_clusters(inode->i_sb, new_i_size); |
3560 | ret = do_sync_mapping_range(inode->i_mapping, new_i_size, | ||
3561 | endbyte - 1, SYNC_FILE_RANGE_WRITE); | ||
3559 | if (ret) | 3562 | if (ret) |
3560 | mlog_errno(ret); | 3563 | mlog_errno(ret); |
3561 | 3564 | ||