aboutsummaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
Diffstat (limited to 'fs')
-rw-r--r--fs/ocfs2/dlmglue.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/fs/ocfs2/dlmglue.c b/fs/ocfs2/dlmglue.c
index e6220137bf69..e335541727f9 100644
--- a/fs/ocfs2/dlmglue.c
+++ b/fs/ocfs2/dlmglue.c
@@ -2718,6 +2718,15 @@ static int ocfs2_data_convert_worker(struct ocfs2_lock_res *lockres,
2718 inode = ocfs2_lock_res_inode(lockres); 2718 inode = ocfs2_lock_res_inode(lockres);
2719 mapping = inode->i_mapping; 2719 mapping = inode->i_mapping;
2720 2720
2721 /*
2722 * We need this before the filemap_fdatawrite() so that it can
2723 * transfer the dirty bit from the PTE to the
2724 * page. Unfortunately this means that even for EX->PR
2725 * downconverts, we'll lose our mappings and have to build
2726 * them up again.
2727 */
2728 unmap_mapping_range(mapping, 0, 0, 0);
2729
2721 if (filemap_fdatawrite(mapping)) { 2730 if (filemap_fdatawrite(mapping)) {
2722 mlog(ML_ERROR, "Could not sync inode %llu for downconvert!", 2731 mlog(ML_ERROR, "Could not sync inode %llu for downconvert!",
2723 (unsigned long long)OCFS2_I(inode)->ip_blkno); 2732 (unsigned long long)OCFS2_I(inode)->ip_blkno);
@@ -2725,7 +2734,6 @@ static int ocfs2_data_convert_worker(struct ocfs2_lock_res *lockres,
2725 sync_mapping_buffers(mapping); 2734 sync_mapping_buffers(mapping);
2726 if (blocking == LKM_EXMODE) { 2735 if (blocking == LKM_EXMODE) {
2727 truncate_inode_pages(mapping, 0); 2736 truncate_inode_pages(mapping, 0);
2728 unmap_mapping_range(mapping, 0, 0, 0);
2729 } else { 2737 } else {
2730 /* We only need to wait on the I/O if we're not also 2738 /* We only need to wait on the I/O if we're not also
2731 * truncating pages because truncate_inode_pages waits 2739 * truncating pages because truncate_inode_pages waits