Skip to contentSkip to conversation

dax: Fix use of zero page

PATCH Applied Matthew Wilcox 2 participants 2 messages Aug 30, 2018

Subsystems (3)
lore
Share & tools
lore

Matthew Wilcox

author reviewer
#0 lore raw

PATCH 1/1 dax: Fix use of zero page

This patch got caught in the crossfire and didn't make it into 4.18 as planned. Can it make 4.19 please?

---- >8 ----

Use my_zero_pfn instead of ZERO_PAGE, and pass the vaddr to it so it works on MIPS and s390.

---
 fs/dax.c | 13 ++-----------
 1 file changed, 2 insertions(+), 11 deletions(-)
fs/dax.c +2 -11
index 467601a134bc..c7917b46a75b 100644
@@ -1093,21 +1093,12 @@ static vm_fault_t dax_load_hole(struct address_space *mapping, void *entry,
 {
 	struct inode *inode = mapping->host;
 	unsigned long vaddr = vmf->address;
-	vm_fault_t ret = VM_FAULT_NOPAGE;
-	struct page *zero_page;
-	pfn_t pfn;
-
-	zero_page = ZERO_PAGE(0);
-	if (unlikely(!zero_page)) {
-		ret = VM_FAULT_OOM;
-		goto out;
-	}
+	pfn_t pfn = pfn_to_pfn_t(my_zero_pfn(vaddr));
+	vm_fault_t ret;
 
-	pfn = page_to_pfn_t(zero_page);
 	dax_insert_mapping_entry(mapping, vmf, entry, pfn, RADIX_DAX_ZERO_PAGE,
 			false);
 	ret = vmf_insert_mixed(vmf->vma, vaddr, pfn);
-out:
 	trace_dax_load_hole(inode, vmf, ret);
 	return ret;
 }
Signature · 6 lines
2.17.1

_______________________________________________
Linux-nvdimm mailing list
[email protected]
https://lists.01.org/mailman/listinfo/linux-nvdimm
maintainer Applied
#1 lore raw
Quoted 11 lines · Matthew Wilcox

This patch got caught in the crossfire and didn't make it into 4.18 as planned. Can it make 4.19 please?

---- >8 ----

Use my_zero_pfn instead of ZERO_PAGE, and pass the vaddr to it so it works on MIPS and s390.

Applied

Quoted 23 lines
---
 fs/dax.c | 13 ++-----------
 1 file changed, 2 insertions(+), 11 deletions(-)
fs/dax.c +1 -9
index 467601a134bc..c7917b46a75b 100644
@@ -1093,21 +1093,12 @@ static vm_fault_t dax_load_hole(struct address_space *mapping, void *entry,
 {
 	struct inode *inode = mapping->host;
 	unsigned long vaddr = vmf->address;
-	vm_fault_t ret = VM_FAULT_NOPAGE;
-	struct page *zero_page;
-	pfn_t pfn;
-
-	zero_page = ZERO_PAGE(0);
-	if (unlikely(!zero_page)) {
-		ret = VM_FAULT_OOM;
-		goto out;
-	}
+	pfn_t pfn = pfn_to_pfn_t(my_zero_pfn(vaddr));

fs/dax.c static vm_fault_t dax_load_hole(struct address_space *mapping, void *entry, · line 1104

Quoted 10 lines
fs/dax.c +1 -2
+	vm_fault_t ret;
 
-	pfn = page_to_pfn_t(zero_page);
 	dax_insert_mapping_entry(mapping, vmf, entry, pfn, RADIX_DAX_ZERO_PAGE,
 			false);
 	ret = vmf_insert_mixed(vmf->vma, vaddr, pfn);
-out:
 	trace_dax_load_hole(inode, vmf, ret);
 	return ret;
 }

_______________________________________________
Linux-nvdimm mailing list
[email protected]
https://lists.01.org/mailman/listinfo/linux-nvdimm