diff options
author | Andrea Arcangeli <aarcange@redhat.com> | 2010-08-09 17:19:08 -0700 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2010-08-09 20:44:58 -0700 |
commit | 26ba0cb63cb8df4e45394227f33c938920b11b88 (patch) | |
tree | 131b785dc7fb0102ee4fc4f56a1ae948b9861501 | |
parent | 5e549e989f94de0596b8149a90e0088e7d4d7c97 (diff) | |
download | op-kernel-dev-26ba0cb63cb8df4e45394227f33c938920b11b88.zip op-kernel-dev-26ba0cb63cb8df4e45394227f33c938920b11b88.tar.gz |
rmap: always add new vmas at the end
Make sure to always add new VMAs at the end of the list. This is
important so rmap_walk does not miss a VMA that was created during the
rmap_walk.
The old code got this right most of the time due to luck, but was buggy
when anon_vma_prepare reused a mergeable anon_vma.
Signed-off-by: Andrea Arcangeli <aarcange@redhat.com>
Signed-off-by: Rik van Riel <riel@redhat.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
-rw-r--r-- | mm/rmap.c | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -147,7 +147,7 @@ int anon_vma_prepare(struct vm_area_struct *vma) avc->anon_vma = anon_vma; avc->vma = vma; list_add(&avc->same_vma, &vma->anon_vma_chain); - list_add(&avc->same_anon_vma, &anon_vma->head); + list_add_tail(&avc->same_anon_vma, &anon_vma->head); allocated = NULL; avc = NULL; } |