linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 2.6.28?] fix migration writepage error
@ 2008-11-14  2:32 Hugh Dickins
  0 siblings, 0 replies; only message in thread
From: Hugh Dickins @ 2008-11-14  2:32 UTC (permalink / raw)
  To: Andrew Morton; +Cc: linux-mm

Page migration's writeout() has got understandably confused by the nasty
AOP_WRITEPAGE_ACTIVATE case: as in normal success, a writepage() error
has unlocked the page, so writeout() then needs to relock it.

Signed-off-by: Hugh Dickins <hugh@veritas.com>
---
I'll remove AOP_WRITEPAGE_ACTIVATE later, but this fix seems more urgent.

 mm/migrate.c |    5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

--- 2.6.28-rc4/mm/migrate.c	2008-11-10 11:27:02.000000000 +0000
+++ linux/mm/migrate.c	2008-11-12 11:52:44.000000000 +0000
@@ -522,15 +522,12 @@ static int writeout(struct address_space
 	remove_migration_ptes(page, page);
 
 	rc = mapping->a_ops->writepage(page, &wbc);
-	if (rc < 0)
-		/* I/O Error writing */
-		return -EIO;
 
 	if (rc != AOP_WRITEPAGE_ACTIVATE)
 		/* unlocked. Relock */
 		lock_page(page);
 
-	return -EAGAIN;
+	return (rc < 0) ? -EIO : -EAGAIN;
 }
 
 /*

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2008-11-14  2:32 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-11-14  2:32 [PATCH 2.6.28?] fix migration writepage error Hugh Dickins

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox