Index: linux-2.6.17-rc2-mm1/mm/migrate.c =================================================================== --- linux-2.6.17-rc2-mm1.orig/mm/migrate.c 2006-04-27 19:52:51.567043204 -0700 +++ linux-2.6.17-rc2-mm1/mm/migrate.c 2006-04-27 20:02:43.465819984 -0700 @@ -287,9 +287,6 @@ if (page_count(page) != 1) return -EAGAIN; - /* We are holding the only remaining reference */ - newpage->index = page->index; - newpage->mapping = page->mapping; return 0; } @@ -311,15 +308,8 @@ /* * Now we know that no one else is looking at the page. - * - * Certain minimal information about a page must be available - * in order for other subsystems to properly handle the page if they - * find it through the radix tree update before we are finished - * copying the page. */ get_page(newpage); - newpage->index = page->index; - newpage->mapping = page->mapping; #ifdef CONFIG_SWAP if (PageSwapCache(page)) { @@ -542,6 +532,9 @@ newpage = lru_to_page(to); lock_page(newpage); + /* Initial settings.*/ + newpage->index = page->index; + newpage->mapping = page->mapping; /* * Pages are properly locked and writeback is complete. @@ -604,8 +597,10 @@ next: if (rc == -EAGAIN) { + newpage->mapping = NULL; retry++; } else if (rc) { + newpage->mapping = NULL; /* Permanent failure */ list_move(&page->lru, failed); nr_failed++;