From: Greg Kroah-Hartman Date: Sun, 3 Jun 2018 20:12:52 +0000 (+0200) Subject: 4.9-stable patches X-Git-Tag: v4.9.106~4 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=447672df4ee32074c3eb49b08fca5b1946ce6a8a;p=thirdparty%2Fkernel%2Fstable-queue.git 4.9-stable patches added patches: mm-fix-the-null-mapping-case-in-__isolate_lru_page.patch --- diff --git a/queue-4.9/mm-fix-the-null-mapping-case-in-__isolate_lru_page.patch b/queue-4.9/mm-fix-the-null-mapping-case-in-__isolate_lru_page.patch new file mode 100644 index 00000000000..9553d85bcc3 --- /dev/null +++ b/queue-4.9/mm-fix-the-null-mapping-case-in-__isolate_lru_page.patch @@ -0,0 +1,47 @@ +From 145e1a71e090575c74969e3daa8136d1e5b99fc8 Mon Sep 17 00:00:00 2001 +From: Hugh Dickins +Date: Fri, 1 Jun 2018 16:50:50 -0700 +Subject: mm: fix the NULL mapping case in __isolate_lru_page() + +From: Hugh Dickins + +commit 145e1a71e090575c74969e3daa8136d1e5b99fc8 upstream. + +George Boole would have noticed a slight error in 4.16 commit +69d763fc6d3a ("mm: pin address_space before dereferencing it while +isolating an LRU page"). Fix it, to match both the comment above it, +and the original behaviour. + +Although anonymous pages are not marked PageDirty at first, we have an +old habit of calling SetPageDirty when a page is removed from swap +cache: so there's a category of ex-swap pages that are easily +migratable, but were inadvertently excluded from compaction's async +migration in 4.16. + +Link: http://lkml.kernel.org/r/alpine.LSU.2.11.1805302014001.12558@eggly.anvils +Fixes: 69d763fc6d3a ("mm: pin address_space before dereferencing it while isolating an LRU page") +Signed-off-by: Hugh Dickins +Acked-by: Minchan Kim +Acked-by: Mel Gorman +Reported-by: Ivan Kalvachev +Cc: "Huang, Ying" +Cc: Jan Kara +Signed-off-by: Andrew Morton +Signed-off-by: Linus Torvalds +Signed-off-by: Greg Kroah-Hartman + +--- + mm/vmscan.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/mm/vmscan.c ++++ b/mm/vmscan.c +@@ -1393,7 +1393,7 @@ int __isolate_lru_page(struct page *page + return ret; + + mapping = page_mapping(page); +- migrate_dirty = mapping && mapping->a_ops->migratepage; ++ migrate_dirty = !mapping || mapping->a_ops->migratepage; + unlock_page(page); + if (!migrate_dirty) + return ret; diff --git a/queue-4.9/series b/queue-4.9/series index 906678e12d1..1849df3f170 100644 --- a/queue-4.9/series +++ b/queue-4.9/series @@ -56,3 +56,4 @@ drm-psr-fix-missed-entry-in-psr-setup-time-table.patch drm-i915-disable-lvds-on-radiant-p845.patch sparc64-fix-build-warnings-with-gcc-7.patch fix-io_destroy-aio_complete-race.patch +mm-fix-the-null-mapping-case-in-__isolate_lru_page.patch