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 tag 'libnvdimm-fixes-5.14-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/nvdimm/nvdimm

Pull libnvdimm fixes from Dan Williams:
"A couple of fixes for long standing bugs, a warning fixup, and some
miscellaneous dax cleanups.

The bugs were recently found due to new platforms looking to use the
ACPI NFIT "virtual" device definition, and new error injection
capabilities to trigger error responses to label area requests. Ira's
cleanups have been long pending, I neglected to send them earlier, and
see no harm in including them now. This has all appeared in -next with
no reported issues.

Summary:

- Fix support for NFIT "virtual" ranges (BIOS-defined memory disks)

- Fix recovery from failed label storage areas on NVDIMM devices

- Miscellaneous cleanups from Ira's investigation of
dax_direct_access paths preparing for stray-write protection"

* tag 'libnvdimm-fixes-5.14-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/nvdimm/nvdimm:
tools/testing/nvdimm: Fix missing 'fallthrough' warning
libnvdimm/region: Fix label activation vs errors
ACPI: NFIT: Fix support for virtual SPA ranges
dax: Ensure errno is returned from dax_direct_access
fs/dax: Clarify nr_pages to dax_direct_access()
fs/fuse: Remove unneeded kaddr parameter

+19 -13
+3
drivers/acpi/nfit/core.c
··· 3021 3021 struct acpi_nfit_memory_map *memdev = nfit_memdev->memdev; 3022 3022 struct nd_mapping_desc *mapping; 3023 3023 3024 + /* range index 0 == unmapped in SPA or invalid-SPA */ 3025 + if (memdev->range_index == 0 || spa->range_index == 0) 3026 + continue; 3024 3027 if (memdev->range_index != spa->range_index) 3025 3028 continue; 3026 3029 if (count >= ND_MAX_MAPPINGS) {
+1 -1
drivers/dax/super.c
··· 313 313 return -ENXIO; 314 314 315 315 if (nr_pages < 0) 316 - return nr_pages; 316 + return -EINVAL; 317 317 318 318 avail = dax_dev->ops->direct_access(dax_dev, pgoff, nr_pages, 319 319 kaddr, pfn);
+11 -6
drivers/nvdimm/namespace_devs.c
··· 2527 2527 2528 2528 static int init_active_labels(struct nd_region *nd_region) 2529 2529 { 2530 - int i; 2530 + int i, rc = 0; 2531 2531 2532 2532 for (i = 0; i < nd_region->ndr_mappings; i++) { 2533 2533 struct nd_mapping *nd_mapping = &nd_region->mapping[i]; ··· 2546 2546 else if (test_bit(NDD_LABELING, &nvdimm->flags)) 2547 2547 /* fail, labels needed to disambiguate dpa */; 2548 2548 else 2549 - return 0; 2549 + continue; 2550 2550 2551 2551 dev_err(&nd_region->dev, "%s: is %s, failing probe\n", 2552 2552 dev_name(&nd_mapping->nvdimm->dev), 2553 2553 test_bit(NDD_LOCKED, &nvdimm->flags) 2554 2554 ? "locked" : "disabled"); 2555 - return -ENXIO; 2555 + rc = -ENXIO; 2556 + goto out; 2556 2557 } 2557 2558 nd_mapping->ndd = ndd; 2558 2559 atomic_inc(&nvdimm->busy); ··· 2587 2586 break; 2588 2587 } 2589 2588 2590 - if (i < nd_region->ndr_mappings) { 2589 + if (i < nd_region->ndr_mappings) 2590 + rc = -ENOMEM; 2591 + 2592 + out: 2593 + if (rc) { 2591 2594 deactivate_labels(nd_region); 2592 - return -ENOMEM; 2595 + return rc; 2593 2596 } 2594 2597 2595 2598 return devm_add_action_or_reset(&nd_region->dev, deactivate_labels, 2596 - nd_region); 2599 + nd_region); 2597 2600 } 2598 2601 2599 2602 int nd_region_register_namespaces(struct nd_region *nd_region, int *err)
+1 -1
fs/dax.c
··· 722 722 return rc; 723 723 724 724 id = dax_read_lock(); 725 - rc = dax_direct_access(dax_dev, pgoff, PHYS_PFN(PAGE_SIZE), &kaddr, NULL); 725 + rc = dax_direct_access(dax_dev, pgoff, 1, &kaddr, NULL); 726 726 if (rc < 0) { 727 727 dax_read_unlock(id); 728 728 return rc;
+2 -4
fs/fuse/dax.c
··· 1235 1235 static int fuse_dax_mem_range_init(struct fuse_conn_dax *fcd) 1236 1236 { 1237 1237 long nr_pages, nr_ranges; 1238 - void *kaddr; 1239 - pfn_t pfn; 1240 1238 struct fuse_dax_mapping *range; 1241 1239 int ret, id; 1242 1240 size_t dax_size = -1; ··· 1246 1248 INIT_DELAYED_WORK(&fcd->free_work, fuse_dax_free_mem_worker); 1247 1249 1248 1250 id = dax_read_lock(); 1249 - nr_pages = dax_direct_access(fcd->dev, 0, PHYS_PFN(dax_size), &kaddr, 1250 - &pfn); 1251 + nr_pages = dax_direct_access(fcd->dev, 0, PHYS_PFN(dax_size), NULL, 1252 + NULL); 1251 1253 dax_read_unlock(id); 1252 1254 if (nr_pages < 0) { 1253 1255 pr_debug("dax_direct_access() returned %ld\n", nr_pages);
+1 -1
tools/testing/nvdimm/test/nfit.c
··· 434 434 dev_dbg(dev, "%s: transition out verify\n", __func__); 435 435 fw->state = FW_STATE_UPDATED; 436 436 fw->missed_activate = false; 437 - /* fall through */ 437 + fallthrough; 438 438 case FW_STATE_UPDATED: 439 439 nd_cmd->status = 0; 440 440 /* bogus test version */