X-Git-Url: http://git.cascardo.eti.br/?a=blobdiff_plain;ds=inline;f=mm%2Fmremap.c;h=87bb8393e7d238115a450139d24c090347c215a7;hb=faed836a2371a96901057f310e436a09eded94fd;hp=d6959cb4df58f1d694c179898553bf7e3150cc49;hpb=09521577ca7718b6c83f095ca4f0d474b01a8378;p=cascardo%2Flinux.git diff --git a/mm/mremap.c b/mm/mremap.c index d6959cb4df58..87bb8393e7d2 100644 --- a/mm/mremap.c +++ b/mm/mremap.c @@ -220,6 +220,15 @@ static unsigned long move_vma(struct vm_area_struct *vma, moved_len = move_page_tables(vma, old_addr, new_vma, new_addr, old_len); if (moved_len < old_len) { + /* + * Before moving the page tables from the new vma to + * the old vma, we need to be sure the old vma is + * queued after new vma in the same_anon_vma list to + * prevent SMP races with rmap_walk (that could lead + * rmap_walk to miss some page table). + */ + anon_vma_moveto_tail(vma); + /* * On error, move entries back from new area to old, * which will succeed since page tables still there,