Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753876Ab0DLU2g (ORCPT ); Mon, 12 Apr 2010 16:28:36 -0400 Received: from smtp1.linux-foundation.org ([140.211.169.13]:51345 "EHLO smtp1.linux-foundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753383Ab0DLU2d (ORCPT ); Mon, 12 Apr 2010 16:28:33 -0400 Date: Mon, 12 Apr 2010 13:23:24 -0700 (PDT) From: Linus Torvalds To: Borislav Petkov cc: Rik van Riel , Johannes Weiner , KOSAKI Motohiro , Andrew Morton , Minchan Kim , Linux Kernel Mailing List , Lee Schermerhorn , Nick Piggin , Andrea Arcangeli , Hugh Dickins , sgunderson@bigfoot.com Subject: [PATCH 3/4] anon_vma: clone the anon_vma chain in the right order In-Reply-To: Message-ID: References: <20100411130801.GA7189@a1.tnic> <20100411185508.GA4450@liondog.tnic> <20100412072056.GA2432@liondog.tnic> <4BC36916.3080005@redhat.com> <20100412190002.GA8595@a1.tnic> User-Agent: Alpine 2.00 (LFD 1167 2008-08-23) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1268 Lines: 36 From: Linus Torvalds Date: Sun, 11 Apr 2010 17:15:03 -0700 Subject: [PATCH 3/4] 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. Signed-off-by: Linus Torvalds --- 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; -- 1.7.1.rc1.dirty -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/