aboutsummaryrefslogtreecommitdiffstats
path: root/mm/migrate.c
diff options
context:
space:
mode:
authorMinchan Kim <minchan.kim@gmail.com>2011-02-01 18:52:33 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2011-02-02 19:03:18 -0500
commit48db54ee2f41e8ae2faf330b55db34a9fffb5b3c (patch)
tree5cdf936bf6996e379784e0b75b982a364f437368 /mm/migrate.c
parent57fc4a5ee322cde96c33f101d3c2d3b79011c05c (diff)
mm/migration: fix page corruption during hugepage migration
If migrate_huge_page by memory-failure fails , it calls put_page in itself to decrease page reference and caller of migrate_huge_page also calls putback_lru_pages. It can do double free of page so it can make page corruption on page holder. In addtion, clean of pages on caller is consistent behavior with migrate_pages by cf608ac19c ("mm: compaction: fix COMPACTPAGEFAILED counting"). Signed-off-by: Minchan Kim <minchan.kim@gmail.com> Cc: Andrea Arcangeli <aarcange@redhat.com> Cc: Christoph Lameter <cl@linux.com> Cc: Mel Gorman <mel@csn.ul.ie> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'mm/migrate.c')
-rw-r--r--mm/migrate.c4
1 files changed, 0 insertions, 4 deletions
diff --git a/mm/migrate.c b/mm/migrate.c
index 155a2e9a8059..766115253807 100644
--- a/mm/migrate.c
+++ b/mm/migrate.c
@@ -980,10 +980,6 @@ int migrate_huge_pages(struct list_head *from,
980 } 980 }
981 rc = 0; 981 rc = 0;
982out: 982out:
983
984 list_for_each_entry_safe(page, page2, from, lru)
985 put_page(page);
986
987 if (rc) 983 if (rc)
988 return rc; 984 return rc;
989 985