From: Mel Gorman Date: Tue, 15 Dec 2009 01:59:53 +0000 (-0800) Subject: hugetlb: acquire the i_mmap_lock before walking the prio_tree to unmap a page X-Git-Tag: v2.6.33-rc1~185 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4eb2b1dcd598f8489130405c81c60c289896d92a;p=pandora-kernel.git hugetlb: acquire the i_mmap_lock before walking the prio_tree to unmap a page When the owner of a mapping fails COW because a child process is holding a reference, the children VMAs are walked and the page is unmapped. The i_mmap_lock is taken for the unmapping of the page but not the walking of the prio_tree. In theory, that tree could be changing if the lock is not held. This patch takes the i_mmap_lock properly for the duration of the prio_tree walk. [hugh.dickins@tiscali.co.uk: Spotted the problem in the first place] Signed-off-by: Mel Gorman Acked-by: Hugh Dickins Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- Reading git-diff-tree failed