Merge branch 'audit.b10' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/audit...
[pandora-kernel.git] / mm / migrate.c
index d444229..1c25040 100644 (file)
@@ -439,6 +439,17 @@ redo:
                        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