Commit 2fa147bd authored by Dan Williams's avatar Dan Williams Committed by Dave Jiang

mm, dev_pagemap: Do not clear ->mapping on final put

MEMORY_DEVICE_FS_DAX relies on typical page semantics whereby ->mapping
is only ever cleared by truncation, not final put.

Without this fix dax pages may forget their mapping association at the
end of every page pin event.

Move this atypical behavior that HMM wants into the HMM ->page_free()

Cc: <>
Cc: Jan Kara <>
Cc: Jérôme Glisse <>
Cc: Andrew Morton <>
Cc: Ross Zwisler <>
Fixes: d2c997c0 ("fs, dax: use page->mapping...")
Signed-off-by: default avatarDan Williams <>
Acked-by: default avatarJérôme Glisse <>
Signed-off-by: default avatarDave Jiang <>
parent 86a66810
......@@ -339,7 +339,6 @@ void __put_devmap_managed_page(struct page *page)
page->mapping = NULL;
page->pgmap->page_free(page, page->pgmap->data);
......@@ -963,6 +963,8 @@ static void hmm_devmem_free(struct page *page, void *data)
struct hmm_devmem *devmem = data;
page->mapping = NULL;
devmem->ops->free(devmem, page);
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