浏览代码

migration: fix writepage error

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>
Cc: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
Cc: Christoph Lameter <cl@linux-foundation.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Hugh Dickins 16 年之前
父节点
当前提交
bda8550dee
共有 1 个文件被更改,包括 1 次插入4 次删除
  1. 1 4
      mm/migrate.c

+ 1 - 4
mm/migrate.c

@@ -522,15 +522,12 @@ static int writeout(struct address_space *mapping, struct page *page)
 	remove_migration_ptes(page, page);
 	remove_migration_ptes(page, page);
 
 
 	rc = mapping->a_ops->writepage(page, &wbc);
 	rc = mapping->a_ops->writepage(page, &wbc);
-	if (rc < 0)
-		/* I/O Error writing */
-		return -EIO;
 
 
 	if (rc != AOP_WRITEPAGE_ACTIVATE)
 	if (rc != AOP_WRITEPAGE_ACTIVATE)
 		/* unlocked. Relock */
 		/* unlocked. Relock */
 		lock_page(page);
 		lock_page(page);
 
 
-	return -EAGAIN;
+	return (rc < 0) ? -EIO : -EAGAIN;
 }
 }
 
 
 /*
 /*