Skip to content

Commit

Permalink
migration: fix writepage error
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Hugh Dickins authored and Linus Torvalds committed Nov 20, 2008
1 parent 966c8c1 commit bda8550
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions mm/migrate.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

/*
Expand Down

0 comments on commit bda8550

Please sign in to comment.