diff --git a/[refs] b/[refs] index 8e90d1bd3f0e..4bf241b12ebf 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: a4b741e380cb56045ccea36f2dbc10e42af21f24 +refs/heads/master: 4c28f81193b6778f7b49090930d88e6d12bcb928 diff --git a/trunk/mm/migrate.c b/trunk/mm/migrate.c index d444229f2599..1c25040693d2 100644 --- a/trunk/mm/migrate.c +++ b/trunk/mm/migrate.c @@ -439,6 +439,17 @@ int migrate_pages(struct list_head *from, struct list_head *to, goto unlock_both; } + /* Make sure the dirty bit is up to date */ + if (try_to_unmap(page, 1) == SWAP_FAIL) { + rc = -EPERM; + goto unlock_both; + } + + if (page_mapcount(page)) { + rc = -EAGAIN; + goto unlock_both; + } + /* * Default handling if a filesystem does not provide * a migration function. We can only migrate clean