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-4.20-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/nvdimm/nvdimm

Pull libnvdimm fixes from Dan Williams:
"A small batch of fixes for v4.20-rc3.

The overflow continuation fix addresses something that has been broken
for several releases. Arguably it could wait even longer, but it's a
one line fix and this finishes the last of the known address range
scrub bug reports. The revert addresses a lockdep regression. The unit
tests are not critical to fix, but no reason to hold this fix back.

Summary:

- Address Range Scrub overflow continuation handling has been broken
since it was initially merged. It was only recently that error
injection and platform-BIOS support enabled this corner case to be
exercised.

- The recent attempt to provide more isolation for the kernel Address
Range Scrub state machine from userapace initiated sessions
triggers a lockdep report. Revert and try again at the next merge
window.

- Fix a kasan reported buffer overflow in libnvdimm unit test
infrastrucutre (nfit_test)"

* tag 'libnvdimm-fixes-4.20-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/nvdimm/nvdimm:
Revert "acpi, nfit: Further restrict userspace ARS start requests"
acpi, nfit: Fix ARS overflow continuation
tools/testing/nvdimm: Fix the array size for dimm devices.

+9 -18
+5 -14
drivers/acpi/nfit/core.c
··· 2928 2928 return rc; 2929 2929 2930 2930 if (ars_status_process_records(acpi_desc)) 2931 - return -ENOMEM; 2931 + dev_err(acpi_desc->dev, "Failed to process ARS records\n"); 2932 2932 2933 - return 0; 2933 + return rc; 2934 2934 } 2935 2935 2936 2936 static int ars_register(struct acpi_nfit_desc *acpi_desc, ··· 3341 3341 struct nvdimm *nvdimm, unsigned int cmd) 3342 3342 { 3343 3343 struct acpi_nfit_desc *acpi_desc = to_acpi_nfit_desc(nd_desc); 3344 - struct nfit_spa *nfit_spa; 3345 - int rc = 0; 3346 3344 3347 3345 if (nvdimm) 3348 3346 return 0; ··· 3353 3355 * just needs guarantees that any ARS it initiates are not 3354 3356 * interrupted by any intervening start requests from userspace. 3355 3357 */ 3356 - mutex_lock(&acpi_desc->init_mutex); 3357 - list_for_each_entry(nfit_spa, &acpi_desc->spas, list) 3358 - if (acpi_desc->scrub_spa 3359 - || test_bit(ARS_REQ_SHORT, &nfit_spa->ars_state) 3360 - || test_bit(ARS_REQ_LONG, &nfit_spa->ars_state)) { 3361 - rc = -EBUSY; 3362 - break; 3363 - } 3364 - mutex_unlock(&acpi_desc->init_mutex); 3358 + if (work_busy(&acpi_desc->dwork.work)) 3359 + return -EBUSY; 3365 3360 3366 - return rc; 3361 + return 0; 3367 3362 } 3368 3363 3369 3364 int acpi_nfit_ars_rescan(struct acpi_nfit_desc *acpi_desc,
+4 -4
tools/testing/nvdimm/test/nfit.c
··· 140 140 [6] = NFIT_DIMM_HANDLE(1, 0, 0, 0, 1), 141 141 }; 142 142 143 - static unsigned long dimm_fail_cmd_flags[NUM_DCR]; 144 - static int dimm_fail_cmd_code[NUM_DCR]; 143 + static unsigned long dimm_fail_cmd_flags[ARRAY_SIZE(handle)]; 144 + static int dimm_fail_cmd_code[ARRAY_SIZE(handle)]; 145 145 146 146 static const struct nd_intel_smart smart_def = { 147 147 .flags = ND_INTEL_SMART_HEALTH_VALID ··· 205 205 unsigned long deadline; 206 206 spinlock_t lock; 207 207 } ars_state; 208 - struct device *dimm_dev[NUM_DCR]; 208 + struct device *dimm_dev[ARRAY_SIZE(handle)]; 209 209 struct nd_intel_smart *smart; 210 210 struct nd_intel_smart_threshold *smart_threshold; 211 211 struct badrange badrange; ··· 2680 2680 u32 nfit_handle = __to_nfit_memdev(nfit_mem)->device_handle; 2681 2681 int i; 2682 2682 2683 - for (i = 0; i < NUM_DCR; i++) 2683 + for (i = 0; i < ARRAY_SIZE(handle); i++) 2684 2684 if (nfit_handle == handle[i]) 2685 2685 dev_set_drvdata(nfit_test->dimm_dev[i], 2686 2686 nfit_mem);