Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit bda8550d authored by Hugh Dickins's avatar Hugh Dickins Committed by Linus Torvalds
Browse files

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: default avatarHugh Dickins <hugh@veritas.com>
Cc: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
Cc: Christoph Lameter <cl@linux-foundation.org>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 966c8c12
Loading
Loading
Loading
Loading
+1 −4
Original line number Diff line number Diff line
@@ -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;
}

/*