mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-29 11:11:45 -04:00
mremap: don't do mm_populate(new_addr) on failure
move_vma() sets *locked even if move_page_tables() or ->mremap() fails, change sys_mremap() to check "ret & ~PAGE_MASK". I think we should simply remove the VM_LOCKED code in move_vma(), that is why this patch doesn't change move_vma(). But this needs more cleanups. Signed-off-by: Oleg Nesterov <[email protected]> Acked-by: David Rientjes <[email protected]> Cc: Benjamin LaHaise <[email protected]> Cc: Hugh Dickins <[email protected]> Cc: Jeff Moyer <[email protected]> Cc: Kirill A. Shutemov <[email protected]> Cc: Laurent Dufour <[email protected]> Cc: Pavel Emelyanov <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
This commit is contained in:
parent
5477e70a64
commit
d456fb9e52
1 changed files with 3 additions and 1 deletions
|
|
@ -578,8 +578,10 @@ SYSCALL_DEFINE5(mremap, unsigned long, addr, unsigned long, old_len,
|
|||
ret = move_vma(vma, addr, old_len, new_len, new_addr, &locked);
|
||||
}
|
||||
out:
|
||||
if (ret & ~PAGE_MASK)
|
||||
if (ret & ~PAGE_MASK) {
|
||||
vm_unacct_memory(charged);
|
||||
locked = 0;
|
||||
}
|
||||
up_write(¤t->mm->mmap_sem);
|
||||
if (locked && new_len > old_len)
|
||||
mm_populate(new_addr + old_len, new_len - old_len);
|
||||
|
|
|
|||
Loading…
Reference in a new issue