Commit 803f57a8 authored by Andrew Morton's avatar Andrew Morton Committed by Linus Torvalds

[PATCH] remove bogus BUG in page_remove_rmap()

Pages with no reverse mapping can be present in page tables as a result
of a driver performing remap_page_range().  Don't go BUG over them.
parent 9c96b76d
...@@ -274,11 +274,11 @@ void page_remove_rmap(struct page * page, pte_t * ptep) ...@@ -274,11 +274,11 @@ void page_remove_rmap(struct page * page, pte_t * ptep)
BUG(); BUG();
if (!pfn_valid(page_to_pfn(page)) || PageReserved(page)) if (!pfn_valid(page_to_pfn(page)) || PageReserved(page))
return; return;
if (!page_mapped(page))
return; /* remap_page_range() from a driver? */
pte_chain_lock(page); pte_chain_lock(page);
BUG_ON(page->pte.direct == 0);
if (PageDirect(page)) { if (PageDirect(page)) {
if (page->pte.direct == pte_paddr) { if (page->pte.direct == pte_paddr) {
page->pte.direct = 0; page->pte.direct = 0;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment