diff options
author | 2015-04-12 10:56:12 -0700 | |
---|---|---|
committer | 2015-04-12 10:56:12 -0700 | |
commit | 6a23b45f1d4b9961e9bf38bc9fb64dc154272abf (patch) | |
tree | fc4ae9cc3a3306743137fea42c463c01090b0e4c /mm | |
parent | Merge branch 'fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/evalenti/linux-soc-thermal (diff) | |
parent | ocfs2: _really_ sync the right range (diff) | |
download | wireguard-linux-6a23b45f1d4b9961e9bf38bc9fb64dc154272abf.tar.xz wireguard-linux-6a23b45f1d4b9961e9bf38bc9fb64dc154272abf.zip |
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs
Pull vfs and fs fixes from Al Viro:
"Several AIO and OCFS2 fixes"
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs:
ocfs2: _really_ sync the right range
ocfs2_file_write_iter: keep return value and current position update in sync
[regression] ocfs2: do *not* increment ->ki_pos twice
ioctx_alloc(): fix vma (and file) leak on failure
fix mremap() vs. ioctx_kill() race
Diffstat (limited to 'mm')
-rw-r--r-- | mm/mremap.c | 10 |
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) { |