anon_vma: clone the anon_vma chain in the right order

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Linux Kernel Mailing List
Date: Monday, April 12, 2010 - 7:59 pm

Gitweb:     http://git.kernel.org/linus/646d87b481dab4ba8301716600dfd276605b0ab0
Commit:     646d87b481dab4ba8301716600dfd276605b0ab0
Parent:     287d97ac032136724143cde8d5964b414d562ee3
Author:     Linus Torvalds <torvalds@linux-foundation.org>
AuthorDate: Sun Apr 11 17:15:03 2010 -0700
Committer:  Linus Torvalds <torvalds@linux-foundation.org>
CommitDate: Mon Apr 12 17:54:12 2010 -0700

    anon_vma: clone the anon_vma chain in the right order
    
    We want to walk the chain in reverse order when cloning it, so that the
    order of the result chain will be the same as the order in the source
    chain.  When we add entries to the chain, they go at the head of the
    chain, so we want to add the source head last.
    
    Reviewed-by: Rik van Riel <riel@redhat.com>
    Acked-by: Johannes Weiner <hannes@cmpxchg.org>
    Tested-by: Borislav Petkov <bp@alien8.de> [ "No, it still oopses" ]
    Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
---
 mm/rmap.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/mm/rmap.c b/mm/rmap.c
index eaa7a09..ee97d38 100644
--- a/mm/rmap.c
+++ b/mm/rmap.c
@@ -182,7 +182,7 @@ int anon_vma_clone(struct vm_area_struct *dst, struct vm_area_struct *src)
 {
 	struct anon_vma_chain *avc, *pavc;
 
-	list_for_each_entry(pavc, &src->anon_vma_chain, same_vma) {
+	list_for_each_entry_reverse(pavc, &src->anon_vma_chain, same_vma) {
 		avc = anon_vma_chain_alloc();
 		if (!avc)
 			goto enomem_failure;
--
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
anon_vma: clone the anon_vma chain in the right order, Linux Kernel Mailing ..., (Mon Apr 12, 7:59 pm)