aboutsummaryrefslogtreecommitdiffstats
path: root/mm/swap_state.c
diff options
context:
space:
mode:
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>2017-10-09 03:02:35 -0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2017-10-09 03:02:35 -0400
commit1236d6bb6e19fc72ffc6bbcdeb1bfefe450e54ee (patch)
tree47da3feee8e263e8c9352c85cf518e624be3c211 /mm/swap_state.c
parent750b1a6894ecc9b178c6e3d0a1170122971b2036 (diff)
parent8a5776a5f49812d29fe4b2d0a2d71675c3facf3f (diff)
Merge 4.14-rc4 into staging-next
We want the staging/iio fixes in here as well to handle merge issues. Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'mm/swap_state.c')
-rw-r--r--mm/swap_state.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/mm/swap_state.c b/mm/swap_state.c
index 71ce2d1ccbf7..ed91091d1e68 100644
--- a/mm/swap_state.c
+++ b/mm/swap_state.c
@@ -242,6 +242,17 @@ int add_to_swap(struct page *page)
242 * clear SWAP_HAS_CACHE flag. 242 * clear SWAP_HAS_CACHE flag.
243 */ 243 */
244 goto fail; 244 goto fail;
245 /*
246 * Normally the page will be dirtied in unmap because its pte should be
247 * dirty. A special case is MADV_FREE page. The page'e pte could have
248 * dirty bit cleared but the page's SwapBacked bit is still set because
249 * clearing the dirty bit and SwapBacked bit has no lock protected. For
250 * such page, unmap will not set dirty bit for it, so page reclaim will
251 * not write the page out. This can cause data corruption when the page
252 * is swap in later. Always setting the dirty bit for the page solves
253 * the problem.
254 */
255 set_page_dirty(page);
245 256
246 return 1; 257 return 1;
247 258