Re: 2.6.18-rc3-mm2 [BUG at mm/vmscan.c:383!]

Hugh Dickins
2006-08-06T14:56:46Z

On Sun, 6 Aug 2006, Mattia Dongili wrote:
> [ 781.988000] kernel BUG at mm/vmscan.c:383!
> [ 781.988000] EIP is at remove_mapping+0xe8/0x120

You are so right: the minor fix below is needed.

> [ 781.988000] DWARF2 unwinder stuck at kernel_thread_helper+0x5/0x10

Sorry, someone else will have to help with all that nuisance.

remove_mapping() must check against page_mapping(page):
&swapper_space is implicit, never actually stored in page->mapping.

Signed-off-by: Hugh Dickins <hugh@veritas.com>

--- 2.6.18-rc3-mm2/mm/vmscan.c 2006-08-06 12:25:40.000000000 +0100
+++ linux/mm/vmscan.c 2006-08-06 15:40:34.000000000 +0100
@@ -380,7 +380,7 @@ static pageout_t pageout(struct page *pa
int remove_mapping(struct address_space *mapping, struct page *page)
{
BUG_ON(!PageLocked(page));
- BUG_ON(mapping != page->mapping);
+ BUG_ON(mapping != page_mapping(page));

write_lock_irq(&mapping->tree_lock);