X-Git-Url: http://ftp.safe.ca/?a=blobdiff_plain;f=mm%2Fmremap.c;h=97bff2547719e702150e1cdc4d4a3f6b31a23213;hb=ffe0d5a575459ffe664b0762130b557f826fcace;hp=93adddecf97858eb51f95e43835c8dfae1133194;hpb=1ff829957316670af64be24192ef849e7253a509;p=safe%2Fjmp%2Flinux-2.6 diff --git a/mm/mremap.c b/mm/mremap.c index 93addde..97bff25 100644 --- a/mm/mremap.c +++ b/mm/mremap.c @@ -86,8 +86,8 @@ static void move_ptes(struct vm_area_struct *vma, pmd_t *old_pmd, if (vma->vm_file) { /* * Subtle point from Rajesh Venkatasubramanian: before - * moving file-based ptes, we must lock vmtruncate out, - * since it might clean the dst vma before the src vma, + * moving file-based ptes, we must lock truncate_pagecache + * out, since it might clean the dst vma before the src vma, * and we propagate stale pages into the dst afterward. */ mapping = vma->vm_file->f_mapping; @@ -175,6 +175,7 @@ static unsigned long move_vma(struct vm_area_struct *vma, unsigned long excess = 0; unsigned long hiwater_vm; int split = 0; + int err; /* * We'd prefer to avoid failure later on in do_munmap: @@ -190,9 +191,10 @@ static unsigned long move_vma(struct vm_area_struct *vma, * pages recently unmapped. But leave vma->vm_flags as it was, * so KSM can come around to merge on vma and new_vma afterwards. */ - if (ksm_madvise(vma, old_addr, old_addr + old_len, - MADV_UNMERGEABLE, &vm_flags)) - return -ENOMEM; + err = ksm_madvise(vma, old_addr, old_addr + old_len, + MADV_UNMERGEABLE, &vm_flags); + if (err) + return err; new_pgoff = vma->vm_pgoff + ((old_addr - vma->vm_start) >> PAGE_SHIFT); new_vma = copy_vma(&vma, new_addr, new_len, new_pgoff);