@@ -419,12 +419,12 @@
return;
}
- /* The page is unshared, and we want write access. In this
- case, it is safe to tear down the swap cache and give the
- page over entirely to this process. */
-
- if (PageSwapCache(page_map))
- delete_from_swap_cache(page_map);
+ /*
+ * The page is unshared and we're going to dirty it - so tear
+ * down the swap cache and give exclusive access to the page to
+ * this process.
+ */
+ delete_from_swap_cache(page_map);
set_pte(page_table, pte_mkwrite(pte_mkdirty(mk_pte(page, vma->vm_page_prot))));
return;
}