Merge tag 'linux-kselftest-3.19-fixes' of git://git.kernel.org/pub/scm/linux/kernel...
[cascardo/linux.git] / mm / mremap.c
index 426b448..17fa018 100644 (file)
@@ -99,7 +99,7 @@ static void move_ptes(struct vm_area_struct *vma, pmd_t *old_pmd,
        spinlock_t *old_ptl, *new_ptl;
 
        /*
-        * When need_rmap_locks is true, we take the i_mmap_mutex and anon_vma
+        * When need_rmap_locks is true, we take the i_mmap_rwsem and anon_vma
         * locks to ensure that rmap will always observe either the old or the
         * new ptes. This is the easiest way to avoid races with
         * truncate_pagecache(), page migration, etc...
@@ -288,7 +288,8 @@ static unsigned long move_vma(struct vm_area_struct *vma,
                old_len = new_len;
                old_addr = new_addr;
                new_addr = -ENOMEM;
-       }
+       } else if (vma->vm_file && vma->vm_file->f_op->mremap)
+               vma->vm_file->f_op->mremap(vma->vm_file, new_vma);
 
        /* Conceal VM_ACCOUNT so old reservation is not undone */
        if (vm_flags & VM_ACCOUNT) {