Skip to content

Commit

Permalink
HWPOISON: fix oops on ksm pages
Browse files Browse the repository at this point in the history
Memory failure on a KSM page currently oopses on its NULL anon_vma in
page_lock_anon_vma(): that may not be much worse than the consequence
of ignoring it, but it is better to be consistent with how ZERO_PAGE
and hugetlb pages and other awkward cases are treated.  Just skip it.

Signed-off-by: Hugh Dickins <hugh.dickins@tiscali.co.uk>
Signed-off-by: Andi Kleen <ak@linux.intel.com>
  • Loading branch information
Hugh Dickins authored and Andi Kleen committed Oct 19, 2009
1 parent 4779cb3 commit 01e00f8
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion mm/memory-failure.c
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
#include <linux/mm.h>
#include <linux/page-flags.h>
#include <linux/sched.h>
#include <linux/ksm.h>
#include <linux/rmap.h>
#include <linux/pagemap.h>
#include <linux/swap.h>
Expand Down Expand Up @@ -644,7 +645,7 @@ static void hwpoison_user_mappings(struct page *p, unsigned long pfn,
int i;
int kill = 1;

if (PageReserved(p) || PageCompound(p) || PageSlab(p))
if (PageReserved(p) || PageCompound(p) || PageSlab(p) || PageKsm(p))
return;

/*
Expand Down

0 comments on commit 01e00f8

Please sign in to comment.