summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHugh Dickins <hugh@veritas.com>2008-11-19 15:36:36 -0800
committerLinus Torvalds <torvalds@linux-foundation.org>2008-11-19 18:49:58 -0800
commitbda8550deed96687f29992d711a88ea21cff4d26 (patch)
tree41061a3259d2ed2e19ed4b9e53e41675eb60bd3f
parent966c8c12dc9e77f931e2281ba25d2f0244b06949 (diff)
downloadop-kernel-dev-bda8550deed96687f29992d711a88ea21cff4d26.zip
op-kernel-dev-bda8550deed96687f29992d711a88ea21cff4d26.tar.gz
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>
-rw-r--r--mm/migrate.c5
1 files changed, 1 insertions, 4 deletions
diff --git a/mm/migrate.c b/mm/migrate.c
index 385db89..1e0d6b2 100644
--- a/mm/migrate.c
+++ b/mm/migrate.c
@@ -522,15 +522,12 @@ static int writeout(struct address_space *mapping, struct page *page)
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;
}
/*
OpenPOWER on IntegriCloud