aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--mm/msync.c17
1 files changed, 2 insertions, 15 deletions
diff --git a/mm/msync.c b/mm/msync.c
index d6a50f3f28b6..2672b8dc3d89 100644
--- a/mm/msync.c
+++ b/mm/msync.c
@@ -9,6 +9,7 @@
9 */ 9 */
10#include <linux/slab.h> 10#include <linux/slab.h>
11#include <linux/pagemap.h> 11#include <linux/pagemap.h>
12#include <linux/fs.h>
12#include <linux/mm.h> 13#include <linux/mm.h>
13#include <linux/mman.h> 14#include <linux/mman.h>
14#include <linux/hugetlb.h> 15#include <linux/hugetlb.h>
@@ -214,23 +215,9 @@ asmlinkage long sys_msync(unsigned long start, size_t len, int flags)
214 vma = find_vma(current->mm, start); 215 vma = find_vma(current->mm, start);
215 } else if ((flags & MS_SYNC) && file && 216 } else if ((flags & MS_SYNC) && file &&
216 (vma->vm_flags & VM_SHARED)) { 217 (vma->vm_flags & VM_SHARED)) {
217 struct address_space *mapping;
218 int err;
219
220 get_file(file); 218 get_file(file);
221 up_read(&current->mm->mmap_sem); 219 up_read(&current->mm->mmap_sem);
222 mapping = file->f_mapping; 220 error = do_fsync(file, 0);
223 error = filemap_fdatawrite(mapping);
224 if (file->f_op && file->f_op->fsync) {
225 mutex_lock(&mapping->host->i_mutex);
226 err = file->f_op->fsync(file,file->f_dentry,1);
227 mutex_unlock(&mapping->host->i_mutex);
228 if (err && !error)
229 error = err;
230 }
231 err = filemap_fdatawait(mapping);
232 if (err && !error)
233 error = err;
234 fput(file); 221 fput(file);
235 down_read(&current->mm->mmap_sem); 222 down_read(&current->mm->mmap_sem);
236 if (error) 223 if (error)