summaryrefslogtreecommitdiffstats
path: root/mm
diff options
context:
space:
mode:
authorAl Viro <viro@zeniv.linux.org.uk>2015-04-11 22:29:51 -0400
committerAl Viro <viro@zeniv.linux.org.uk>2015-04-11 22:29:51 -0400
commitdfea934575164497a9e36074ebce606a1a278ed9 (patch)
treeb39ec564ae5a84956af80ae43de24c4f91720519 /mm
parent165f1a6e300d5a1ffb57cf9a9c8762de731228f2 (diff)
parent64b4e2526d1cf6e6a4db6213d6e2b6e6ab59479a (diff)
downloadlinux-stable-dfea934575164497a9e36074ebce606a1a278ed9.tar.gz
linux-stable-dfea934575164497a9e36074ebce606a1a278ed9.tar.bz2
linux-stable-dfea934575164497a9e36074ebce606a1a278ed9.zip
Merge branch 'for-linus' into for-next
Diffstat (limited to 'mm')
-rw-r--r--mm/mremap.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/mm/mremap.c b/mm/mremap.c
index 57dadc025c64..2dc44b1cb1df 100644
--- a/mm/mremap.c
+++ b/mm/mremap.c
@@ -286,8 +286,14 @@ 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);
+ } else if (vma->vm_file && vma->vm_file->f_op->mremap) {
+ err = vma->vm_file->f_op->mremap(vma->vm_file, new_vma);
+ if (err < 0) {
+ move_page_tables(new_vma, new_addr, vma, old_addr,
+ moved_len, true);
+ return err;
+ }
+ }
/* Conceal VM_ACCOUNT so old reservation is not undone */
if (vm_flags & VM_ACCOUNT) {