Commit 93a9eb39fad1b5fc9077776caa3af207883b254d

Authored by Naoya Horiguchi
Committed by Linus Torvalds
1 parent 0193ed8225

hwpoison: fix hugetlbfs/thp precheck in hwpoison_user_mappings()

A recent fix from Chen Yucong, commit 0bc1f8b0682c ("hwpoison: fix the
handling path of the victimized page frame that belong to non-LRU")
rejects going into unmapping operation for hugetlbfs/thp pages, which
results in failing error containing on such pages.  This patch fixes it.

With this patch, hwpoison functional tests in mce-test testsuite pass.

Signed-off-by: Naoya Horiguchi <n-horiguchi@ah.jp.nec.com>
Cc: Andi Kleen <andi@firstfloor.org>
Cc: Chen Yucong <slaoub@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

Showing 1 changed file with 7 additions and 1 deletions Side-by-side Diff

... ... @@ -895,7 +895,13 @@
895 895 struct page *hpage = *hpagep;
896 896 struct page *ppage;
897 897  
898   - if (PageReserved(p) || PageSlab(p) || !PageLRU(p))
  898 + /*
  899 + * Here we are interested only in user-mapped pages, so skip any
  900 + * other types of pages.
  901 + */
  902 + if (PageReserved(p) || PageSlab(p))
  903 + return SWAP_SUCCESS;
  904 + if (!(PageLRU(hpage) || PageHuge(p)))
899 905 return SWAP_SUCCESS;
900 906  
901 907 /*