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 build fix, a NULL de-reference found by static analysis, a misuse of
the percpu_ref_exit() (tagged for -stable), and notification of failed
attempts to clear media errors.

These patches have received a build success notification from the
0day- kbuild-robot and appeared in next-20161028"

* 'libnvdimm-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/nvdimm/nvdimm:
device-dax: fix percpu_ref_exit ordering
nvdimm: make CONFIG_NVDIMM_DAX 'bool'
pmem: report error on clear poison failure
libnvdimm, namespace: potential NULL deref on allocation error

+17 -11
+1 -1
drivers/dax/Kconfig
··· 14 14 15 15 config DEV_DAX_PMEM 16 16 tristate "PMEM DAX: direct access to persistent memory" 17 - depends on NVDIMM_DAX 17 + depends on LIBNVDIMM && NVDIMM_DAX 18 18 default DEV_DAX 19 19 help 20 20 Support raw access to persistent memory. Note that this
+1 -1
drivers/dax/pmem.c
··· 44 44 45 45 dev_dbg(dax_pmem->dev, "%s\n", __func__); 46 46 percpu_ref_exit(ref); 47 - wait_for_completion(&dax_pmem->cmp); 48 47 } 49 48 50 49 static void dax_pmem_percpu_kill(void *data) ··· 53 54 54 55 dev_dbg(dax_pmem->dev, "%s\n", __func__); 55 56 percpu_ref_kill(ref); 57 + wait_for_completion(&dax_pmem->cmp); 56 58 } 57 59 58 60 static int dax_pmem_probe(struct device *dev)
+1 -1
drivers/nvdimm/Kconfig
··· 89 89 Select Y if unsure 90 90 91 91 config NVDIMM_DAX 92 - tristate "NVDIMM DAX: Raw access to persistent memory" 92 + bool "NVDIMM DAX: Raw access to persistent memory" 93 93 default LIBNVDIMM 94 94 depends on NVDIMM_PFN 95 95 help
+8 -6
drivers/nvdimm/namespace_devs.c
··· 2176 2176 return devs; 2177 2177 2178 2178 err: 2179 - for (i = 0; devs[i]; i++) 2180 - if (is_nd_blk(&nd_region->dev)) 2181 - namespace_blk_release(devs[i]); 2182 - else 2183 - namespace_pmem_release(devs[i]); 2184 - kfree(devs); 2179 + if (devs) { 2180 + for (i = 0; devs[i]; i++) 2181 + if (is_nd_blk(&nd_region->dev)) 2182 + namespace_blk_release(devs[i]); 2183 + else 2184 + namespace_pmem_release(devs[i]); 2185 + kfree(devs); 2186 + } 2185 2187 return NULL; 2186 2188 } 2187 2189
+6 -2
drivers/nvdimm/pmem.c
··· 47 47 return to_nd_region(to_dev(pmem)->parent); 48 48 } 49 49 50 - static void pmem_clear_poison(struct pmem_device *pmem, phys_addr_t offset, 50 + static int pmem_clear_poison(struct pmem_device *pmem, phys_addr_t offset, 51 51 unsigned int len) 52 52 { 53 53 struct device *dev = to_dev(pmem); ··· 62 62 __func__, (unsigned long long) sector, 63 63 cleared / 512, cleared / 512 > 1 ? "s" : ""); 64 64 badblocks_clear(&pmem->bb, sector, cleared / 512); 65 + } else { 66 + return -EIO; 65 67 } 68 + 66 69 invalidate_pmem(pmem->virt_addr + offset, len); 70 + return 0; 67 71 } 68 72 69 73 static void write_pmem(void *pmem_addr, struct page *page, ··· 127 123 flush_dcache_page(page); 128 124 write_pmem(pmem_addr, page, off, len); 129 125 if (unlikely(bad_pmem)) { 130 - pmem_clear_poison(pmem, pmem_off, len); 126 + rc = pmem_clear_poison(pmem, pmem_off, len); 131 127 write_pmem(pmem_addr, page, off, len); 132 128 } 133 129 }