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.

Merge branch 'libnvdimm-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/nvdimm/nvdimm

Pull libnvdimm fixes from Dan Williams:

- a boot regression (since v4.2) fix for some ARM configurations from
Tyler

- regression (since v4.1) fixes for mkfs.xfs on a DAX enabled device
from Jeff. These are tagged for -stable.

- a pair of locking fixes from Axel that are hidden from lockdep since
they involve device_lock(). The "btt" one is tagged for -stable, the
other only applies to the new "pfn" mechanism in v4.3.

- a fix for the pmem ->rw_page() path to use wmb_pmem() from Ross.

* 'libnvdimm-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/nvdimm/nvdimm:
mm: fix type cast in __pfn_to_phys()
pmem: add proper fencing to pmem_rw_page()
libnvdimm: pfn_devs: Fix locking in namespace_store
libnvdimm: btt_devs: Fix locking in namespace_store
blockdev: don't set S_DAX for misaligned partitions
dax: fix O_DIRECT I/O to the last block of a blockdev

+16 -6
+2 -2
drivers/nvdimm/btt_devs.c
··· 128 128 struct nd_btt *nd_btt = to_nd_btt(dev); 129 129 ssize_t rc; 130 130 131 - nvdimm_bus_lock(dev); 132 131 device_lock(dev); 132 + nvdimm_bus_lock(dev); 133 133 rc = nd_namespace_store(dev, &nd_btt->ndns, buf, len); 134 134 dev_dbg(dev, "%s: result: %zd wrote: %s%s", __func__, 135 135 rc, buf, buf[len - 1] == '\n' ? "" : "\n"); 136 - device_unlock(dev); 137 136 nvdimm_bus_unlock(dev); 137 + device_unlock(dev); 138 138 139 139 return rc; 140 140 }
+2 -2
drivers/nvdimm/pfn_devs.c
··· 148 148 struct nd_pfn *nd_pfn = to_nd_pfn(dev); 149 149 ssize_t rc; 150 150 151 - nvdimm_bus_lock(dev); 152 151 device_lock(dev); 152 + nvdimm_bus_lock(dev); 153 153 rc = nd_namespace_store(dev, &nd_pfn->ndns, buf, len); 154 154 dev_dbg(dev, "%s: result: %zd wrote: %s%s", __func__, 155 155 rc, buf, buf[len - 1] == '\n' ? "" : "\n"); 156 - device_unlock(dev); 157 156 nvdimm_bus_unlock(dev); 157 + device_unlock(dev); 158 158 159 159 return rc; 160 160 }
+2
drivers/nvdimm/pmem.c
··· 92 92 struct pmem_device *pmem = bdev->bd_disk->private_data; 93 93 94 94 pmem_do_bvec(pmem, page, PAGE_CACHE_SIZE, 0, rw, sector); 95 + if (rw & WRITE) 96 + wmb_pmem(); 95 97 page_endio(page, rw & WRITE, 0); 96 98 97 99 return 0;
+7
fs/block_dev.c
··· 1242 1242 goto out_clear; 1243 1243 } 1244 1244 bd_set_size(bdev, (loff_t)bdev->bd_part->nr_sects << 9); 1245 + /* 1246 + * If the partition is not aligned on a page 1247 + * boundary, we can't do dax I/O to it. 1248 + */ 1249 + if ((bdev->bd_part->start_sect % (PAGE_SIZE / 512)) || 1250 + (bdev->bd_part->nr_sects % (PAGE_SIZE / 512))) 1251 + bdev->bd_inode->i_flags &= ~S_DAX; 1245 1252 } 1246 1253 } else { 1247 1254 if (bdev->bd_contains == bdev) {
+2 -1
fs/dax.c
··· 119 119 size_t len; 120 120 if (pos == max) { 121 121 unsigned blkbits = inode->i_blkbits; 122 - sector_t block = pos >> blkbits; 122 + long page = pos >> PAGE_SHIFT; 123 + sector_t block = page << (PAGE_SHIFT - blkbits); 123 124 unsigned first = pos - (block << blkbits); 124 125 long size; 125 126
+1 -1
include/asm-generic/memory_model.h
··· 73 73 * Convert a physical address to a Page Frame Number and back 74 74 */ 75 75 #define __phys_to_pfn(paddr) ((unsigned long)((paddr) >> PAGE_SHIFT)) 76 - #define __pfn_to_phys(pfn) ((pfn) << PAGE_SHIFT) 76 + #define __pfn_to_phys(pfn) PFN_PHYS(pfn) 77 77 78 78 #define page_to_pfn __page_to_pfn 79 79 #define pfn_to_page __pfn_to_page