Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=8064ab4da104900505f33535d230ce0da5d18341
Commit:     8064ab4da104900505f33535d230ce0da5d18341
Parent:     cb00e99c0abd844b884c64c6b54aa3b7d345ebb1
Author:     Steve French <[EMAIL PROTECTED]>
AuthorDate: Wed Aug 22 22:12:07 2007 +0000
Committer:  Steve French <[EMAIL PROTECTED]>
CommitDate: Wed Aug 22 22:12:07 2007 +0000

    [CIFS] cifs truncate missing a fix for private map COW race
    
    vmtruncate had added the same fix to handle the case of private pages
    being Copy on writed while truncate_inode_pages is going on
    
    Signed-off-by: Steve French <[EMAIL PROTECTED]>
---
 fs/cifs/inode.c |    9 +++++++++
 1 files changed, 9 insertions(+), 0 deletions(-)

diff --git a/fs/cifs/inode.c b/fs/cifs/inode.c
index dd41677..97ccc51 100644
--- a/fs/cifs/inode.c
+++ b/fs/cifs/inode.c
@@ -1377,8 +1377,17 @@ static int cifs_vmtruncate(struct inode *inode, loff_t 
offset)
        }
        i_size_write(inode, offset);
        spin_unlock(&inode->i_lock);
+       /*
+        * unmap_mapping_range is called twice, first simply for efficiency
+        * so that truncate_inode_pages does fewer single-page unmaps. However
+        * after this first call, and before truncate_inode_pages finishes,
+        * it is possible for private pages to be COWed, which remain after
+        * truncate_inode_pages finishes, hence the second unmap_mapping_range
+        * call must be made for correctness.
+        */
        unmap_mapping_range(mapping, offset + PAGE_SIZE - 1, 0, 1);
        truncate_inode_pages(mapping, offset);
+       unmap_mapping_range(mapping, offset + PAGE_SIZE - 1, 0, 1);
        goto out_truncate;
 
 do_expand:
-
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