Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

erge tag 'libnvdimm-fixes-4.19-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/nvdimm/nvdimm

Dan writes:
"libnvdimm/dax for 4.19-rc6

* (2) fixes for the dax error handling updates that were merged for
v4.19-rc1. My mails to Al have been bouncing recently, so I do not have
his ack but the uaccess change is of the trivial / obviously correct
variety. The address_space_operations fixes a regression.

* A filesystem-dax fix to correct the zero page lookup to be compatible
with non-x86 (mips and s390) architectures."

* tag 'libnvdimm-fixes-4.19-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/nvdimm/nvdimm:
device-dax: Add missing address_space_operations
uaccess: Fix is_source param for check_copy_size() in copy_to_iter_mcsafe()
filesystem-dax: Fix use of zero page

+9 -12
+6
drivers/dax/device.c
··· 535 535 return current->mm->get_unmapped_area(filp, addr, len, pgoff, flags); 536 536 } 537 537 538 + static const struct address_space_operations dev_dax_aops = { 539 + .set_page_dirty = noop_set_page_dirty, 540 + .invalidatepage = noop_invalidatepage, 541 + }; 542 + 538 543 static int dax_open(struct inode *inode, struct file *filp) 539 544 { 540 545 struct dax_device *dax_dev = inode_dax(inode); ··· 549 544 dev_dbg(&dev_dax->dev, "trace\n"); 550 545 inode->i_mapping = __dax_inode->i_mapping; 551 546 inode->i_mapping->host = __dax_inode; 547 + inode->i_mapping->a_ops = &dev_dax_aops; 552 548 filp->f_mapping = inode->i_mapping; 553 549 filp->f_wb_err = filemap_sample_wb_err(filp->f_mapping); 554 550 filp->private_data = dev_dax;
+2 -11
fs/dax.c
··· 1120 1120 { 1121 1121 struct inode *inode = mapping->host; 1122 1122 unsigned long vaddr = vmf->address; 1123 - vm_fault_t ret = VM_FAULT_NOPAGE; 1124 - struct page *zero_page; 1125 - pfn_t pfn; 1123 + pfn_t pfn = pfn_to_pfn_t(my_zero_pfn(vaddr)); 1124 + vm_fault_t ret; 1126 1125 1127 - zero_page = ZERO_PAGE(0); 1128 - if (unlikely(!zero_page)) { 1129 - ret = VM_FAULT_OOM; 1130 - goto out; 1131 - } 1132 - 1133 - pfn = page_to_pfn_t(zero_page); 1134 1126 dax_insert_mapping_entry(mapping, vmf, entry, pfn, RADIX_DAX_ZERO_PAGE, 1135 1127 false); 1136 1128 ret = vmf_insert_mixed(vmf->vma, vaddr, pfn); 1137 - out: 1138 1129 trace_dax_load_hole(inode, vmf, ret); 1139 1130 return ret; 1140 1131 }
+1 -1
include/linux/uio.h
··· 172 172 static __always_inline __must_check 173 173 size_t copy_to_iter_mcsafe(void *addr, size_t bytes, struct iov_iter *i) 174 174 { 175 - if (unlikely(!check_copy_size(addr, bytes, false))) 175 + if (unlikely(!check_copy_size(addr, bytes, true))) 176 176 return 0; 177 177 else 178 178 return _copy_to_iter_mcsafe(addr, bytes, i);