linux_dsm_epyc7002/drivers/nvdimm
Dan Williams c4703ce11c libnvdimm/namespace: Fix label tracking error
Users have reported intermittent occurrences of DIMM initialization
failures due to duplicate allocations of address capacity detected in
the labels, or errors of the form below, both have the same root cause.

    nd namespace1.4: failed to track label: 0
    WARNING: CPU: 17 PID: 1381 at drivers/nvdimm/label.c:863

    RIP: 0010:__pmem_label_update+0x56c/0x590 [libnvdimm]
    Call Trace:
     ? nd_pmem_namespace_label_update+0xd6/0x160 [libnvdimm]
     nd_pmem_namespace_label_update+0xd6/0x160 [libnvdimm]
     uuid_store+0x17e/0x190 [libnvdimm]
     kernfs_fop_write+0xf0/0x1a0
     vfs_write+0xb7/0x1b0
     ksys_write+0x57/0xd0
     do_syscall_64+0x60/0x210

Unfortunately those reports were typically with a busy parallel
namespace creation / destruction loop making it difficult to see the
components of the bug. However, Jane provided a simple reproducer using
the work-in-progress sub-section implementation.

When ndctl is reconfiguring a namespace it may take an existing defunct
/ disabled namespace and reconfigure it with a new uuid and other
parameters. Critically namespace_update_uuid() takes existing address
resources and renames them for the new namespace to use / reconfigure as
it sees fit. The bug is that this rename only happens in the resource
tracking tree. Existing labels with the old uuid are not reaped leading
to a scenario where multiple active labels reference the same span of
address range.

Teach namespace_update_uuid() to flag any references to the old uuid for
reaping at the next label update attempt.

Cc: <stable@vger.kernel.org>
Fixes: bf9bccc14c ("libnvdimm: pmem label sets and namespace instantiation")
Link: https://github.com/pmem/ndctl/issues/91
Reported-by: Jane Chu <jane.chu@oracle.com>
Reported-by: Jeff Moyer <jmoyer@redhat.com>
Reported-by: Erwin Tsaur <erwin.tsaur@oracle.com>
Cc: Johannes Thumshirn <jthumshirn@suse.de>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
2019-04-30 21:51:21 -07:00
..
badrange.c libnvdimm, badrange: remove a WARN for list_empty 2017-11-02 10:42:30 -07:00
blk.c block: genhd: add 'groups' argument to device_add_disk 2018-09-28 08:30:28 -06:00
btt_devs.c libnvdimm/btt: Fix a kmemdup failure check 2019-03-27 10:08:55 -07:00
btt.c libnvdimm/btt: Fix LBA masking during 'free list' population 2019-02-28 09:57:39 -08:00
btt.h libnvdimm/btt: Fix LBA masking during 'free list' population 2019-02-28 09:57:39 -08:00
bus.c libnvdimm: Schedule device registration on node local to the device 2019-01-31 14:20:54 +01:00
claim.c libnvdimm, pmem: Fix memcpy_mcsafe() return code handling in nsio_rw_bytes() 2018-06-28 18:21:30 -07:00
core.c libnvdimm: remove redundant __func__ in dev_dbg 2018-03-06 08:44:17 -08:00
dax_devs.c libnvdimm: remove redundant __func__ in dev_dbg 2018-03-06 08:44:17 -08:00
dimm_devs.c Merge branch 'for-5.1/libnvdimm' into libnvdimm-for-next 2019-03-11 12:13:42 -07:00
dimm.c libnvdimm/security: Require nvdimm_security_setup_events() to succeed 2019-01-21 09:57:43 -08:00
e820.c acpi/nfit, device-dax: Identify differentiated memory with a unique numa-node 2019-01-06 21:41:57 -08:00
Kconfig acpi/nfit, libnvdimm: Add unlock of nvdimm support for Intel DIMMs 2018-12-13 17:54:13 -08:00
label.c libnvdimm/namespace: Fix label tracking error 2019-04-30 21:51:21 -07:00
label.h nvdimm: Use namespace index data to reduce number of label reads needed 2018-10-12 08:39:31 -07:00
Makefile acpi/nfit, libnvdimm: Add unlock of nvdimm support for Intel DIMMs 2018-12-13 17:54:13 -08:00
namespace_devs.c libnvdimm/namespace: Fix label tracking error 2019-04-30 21:51:21 -07:00
nd-core.h libnvdimm/security: Fix nvdimm_security_state() state request selection 2019-01-15 13:54:33 -08:00
nd.h libnvdimm/namespace: Fix label tracking error 2019-04-30 21:51:21 -07:00
of_pmem.c device-dax for 5.1 2019-03-16 13:05:32 -07:00
pfn_devs.c libnvdimm/pfn: Remove dax_label_reserve 2019-02-22 11:52:32 -08:00
pfn.h libnvdimm, dax: autodetect support 2016-05-20 22:02:57 -07:00
pmem.c libnvdimm/pmem: fix a possible OOB access when read and write pmem 2019-04-07 14:36:04 -07:00
pmem.h libnvdimm, pmem: Restore page attributes when clearing errors 2018-08-20 09:22:45 -07:00
region_devs.c device-dax for 5.1 2019-03-16 13:05:32 -07:00
region.c libnvdimm, region: quiet region probe 2018-04-07 07:47:10 -07:00
security.c libnvdimm/security, acpi/nfit: unify zero-key for all security commands 2019-03-30 08:27:07 -07:00