Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=7f4a2a97e324e8c826d1d983bc8efb5c59194f02
Commit:     7f4a2a97e324e8c826d1d983bc8efb5c59194f02
Parent:     6c2aad0567e693f9588d0a0683f96ed872fb4641
Author:     Mark Fasheh <[EMAIL PROTECTED]>
AuthorDate: Mon Dec 11 11:06:36 2006 -0800
Committer:  Mark Fasheh <[EMAIL PROTECTED]>
CommitDate: Thu Dec 28 16:38:59 2006 -0800

    ocfs2: always unmap in ocfs2_data_convert_worker()
    
    Mmap-heavy clustered workloads were sometimes finding stale data on mmap
    reads. The solution is to call unmap_mapping_range() on any down convert of
    a data lock.
    
    Signed-off-by: Mark Fasheh <[EMAIL PROTECTED]>
---
 fs/ocfs2/dlmglue.c |   10 +++++++++-
 1 files changed, 9 insertions(+), 1 deletions(-)

diff --git a/fs/ocfs2/dlmglue.c b/fs/ocfs2/dlmglue.c
index e622013..e335541 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,
                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
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to