diff options
Diffstat (limited to 'mm/memory.c')
-rw-r--r-- | mm/memory.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/mm/memory.c b/mm/memory.c index ba571d23ea05..af27127c235e 100644 --- a/mm/memory.c +++ b/mm/memory.c @@ -3676,14 +3676,18 @@ static vm_fault_t __do_fault(struct vm_fault *vmf) return ret; if (unlikely(PageHWPoison(vmf->page))) { + struct page *page = vmf->page; vm_fault_t poisonret = VM_FAULT_HWPOISON; if (ret & VM_FAULT_LOCKED) { + if (page_mapped(page)) + unmap_mapping_pages(page_mapping(page), + page->index, 1, false); /* Retry if a clean page was removed from the cache. */ - if (invalidate_inode_page(vmf->page)) - poisonret = 0; - unlock_page(vmf->page); + if (invalidate_inode_page(page)) + poisonret = VM_FAULT_NOPAGE; + unlock_page(page); } - put_page(vmf->page); + put_page(page); vmf->page = NULL; return poisonret; } |