
From: Hirokazu Takahashi <taka@valinux.co.jp>

Hi Dave,

The following patch makes unwind() call unlock(newpage) earlier.
This removes the bad restriction that any kernel code must
call put_page() before lock_page() when the code notices
unwind() has been called.

I realized lock_replace_page() in the previous patch required
this patch.

Please apply it after P10-rename_rewind_page_to_unwind_page.patch .

Thanks,
Hirokazu Takahashi.

Signed-off-by: Dave Hansen <haveblue@us.ibm.com>
---

 memhotplug-dave/mm/mmigrate.c |    2 +-
 1 files changed, 1 insertion(+), 1 deletion(-)

diff -puN mm/mmigrate.c~AA-PM-10.2-fix-rewind-locking mm/mmigrate.c
--- memhotplug/mm/mmigrate.c~AA-PM-10.2-fix-rewind-locking	2005-03-28 16:38:16.000000000 -0800
+++ memhotplug-dave/mm/mmigrate.c	2005-03-28 16:38:16.000000000 -0800
@@ -202,6 +202,7 @@ out:
 	ClearPageSwapCache(newpage);
 	/* XXX unmap needed?  No, it shouldn't.  Handled by fault handlers. */
 	unlock_page(newpage);
+	unlock_page(page);
 
 	/*
 	 *  Some requests may be blocked on the newpage. Wait until the
@@ -224,7 +225,6 @@ out:
 	BUG_ON(PageActive(newpage));
 	BUG_ON(PagePrivate(newpage));
 	BUG_ON(page_count(newpage) != 2);
-	unlock_page(page);
 	page_cache_release(newpage);
 	return 0;
 }
_
