From f3ca4798ac2a329bd8fefbc5652aba66313fa771 Mon Sep 17 00:00:00 2001 From: Mark Fasheh Date: Mon, 11 Dec 2006 11:06:36 -0800 Subject: [PATCH] --- yaml --- r: 45150 b: refs/heads/master c: 7f4a2a97e324e8c826d1d983bc8efb5c59194f02 h: refs/heads/master v: v3 --- [refs] | 2 +- trunk/fs/ocfs2/dlmglue.c | 10 +++++++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/[refs] b/[refs] index c16244444285..593842055b2d 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 6c2aad0567e693f9588d0a0683f96ed872fb4641 +refs/heads/master: 7f4a2a97e324e8c826d1d983bc8efb5c59194f02 diff --git a/trunk/fs/ocfs2/dlmglue.c b/trunk/fs/ocfs2/dlmglue.c index e6220137bf69..e335541727f9 100644 --- a/trunk/fs/ocfs2/dlmglue.c +++ b/trunk/fs/ocfs2/dlmglue.c @@ -2718,6 +2718,15 @@ static int ocfs2_data_convert_worker(struct ocfs2_lock_res *lockres, inode = ocfs2_lock_res_inode(lockres); mapping = inode->i_mapping; + /* + * We need this before the filemap_fdatawrite() so that it can + * transfer the dirty bit from the PTE to the + * page. Unfortunately this means that even for EX->PR + * downconverts, we'll lose our mappings and have to build + * them up again. + */ + unmap_mapping_range(mapping, 0, 0, 0); + if (filemap_fdatawrite(mapping)) { mlog(ML_ERROR, "Could not sync inode %llu for downconvert!", (unsigned long long)OCFS2_I(inode)->ip_blkno); @@ -2725,7 +2734,6 @@ static int ocfs2_data_convert_worker(struct ocfs2_lock_res *lockres, sync_mapping_buffers(mapping); if (blocking == LKM_EXMODE) { truncate_inode_pages(mapping, 0); - unmap_mapping_range(mapping, 0, 0, 0); } else { /* We only need to wait on the I/O if we're not also * truncating pages because truncate_inode_pages waits