1
0
Fork 0
alistair23-linux/drivers/nvdimm
Dan Williams c16b584935 libnvdimm/namespace: Fix reaping of invalidated block-window-namespace labels
commit 2dd2a1740e upstream.

A recent change to ndctl to attempt to reconfigure namespaces in place
uncovered a label accounting problem in block-window-type namespaces.
The ndctl "create.sh" test is able to trigger this signature:

 WARNING: CPU: 34 PID: 9167 at drivers/nvdimm/label.c:1100 __blk_label_update+0x9a3/0xbc0 [libnvdimm]
 [..]
 RIP: 0010:__blk_label_update+0x9a3/0xbc0 [libnvdimm]
 [..]
 Call Trace:
  uuid_store+0x21b/0x2f0 [libnvdimm]
  kernfs_fop_write+0xcf/0x1c0
  vfs_write+0xcc/0x380
  ksys_write+0x68/0xe0

When allocated capacity for a namespace is renamed (new UUID) the labels
with the old UUID need to be deleted. The ndctl behavior to always
destroy namespaces on reconfiguration hid this problem.

The immediate impact of this bug is limited since block-window-type
namespaces only seem to exist in the specification and not in any
shipping products. However, the label handling code is being reused for
other technologies like CXL region labels, so there is a benefit to
making sure both vertical labels sets (block-window) and horizontal
label sets (pmem) have a functional reference implementation in
libnvdimm.

Fixes: c4703ce11c ("libnvdimm/namespace: Fix label tracking error")
Cc: <stable@vger.kernel.org>
Cc: Vishal Verma <vishal.l.verma@intel.com>
Cc: Dave Jiang <dave.jiang@intel.com>
Cc: Ira Weiny <ira.weiny@intel.com>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-12-30 11:51:47 +01:00
..
Kconfig libnvdimm: Enable unit test infrastructure compile checks 2019-09-07 04:28:05 -03:00
Makefile libnvdimm: Enable unit test infrastructure compile checks 2019-09-07 04:28:05 -03:00
badrange.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 295 2019-06-05 17:36:38 +02:00
blk.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 288 2019-06-05 17:36:37 +02:00
btt.c libnvdimm/btt: fix variable 'rc' set but not used 2020-01-04 19:18:12 +01:00
btt.h treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 288 2019-06-05 17:36:37 +02:00
btt_devs.c driver-core, libnvdimm: Let device subsystems add local lockdep coverage 2019-07-18 16:23:27 -07:00
bus.c libnvdimm: Out of bounds read in __nd_ioctl() 2020-04-23 10:36:42 +02:00
claim.c libnvdimm: nd_region flush callback support 2019-07-05 15:19:10 -07:00
core.c driver-core, libnvdimm: Let device subsystems add local lockdep coverage 2019-07-18 16:23:27 -07:00
dax_devs.c libnvdimm/pfn: fix fsdax-mode namespace info-block zero-fields 2019-07-18 17:08:07 -07:00
dimm.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 295 2019-06-05 17:36:38 +02:00
dimm_devs.c libnvdimm/security: Consolidate 'security' operations 2019-08-29 13:51:57 -07:00
e820.c treewide: Add SPDX license identifier for more missed files 2019-05-21 10:50:45 +02:00
label.c libnvdimm/namespace: Fix reaping of invalidated block-window-namespace labels 2020-12-30 11:51:47 +01:00
label.h treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 295 2019-06-05 17:36:38 +02:00
namespace_devs.c libnvdimm: Fix endian conversion issues 2019-09-24 10:23:44 -07:00
nd-core.h libnvdimm/region: Rewrite _probe_success() to _advance_seeds() 2019-09-05 16:11:14 -07:00
nd.h libnvdimm/dax: Pick the right alignment default when creating dax devices 2019-09-24 10:23:41 -07:00
nd_virtio.c virtio_pmem: fix sparse warning 2019-07-16 19:44:26 -07:00
of_pmem.c libnvdimm/of_pmem: Provide a unique name for bus provider 2019-08-13 20:31:57 -07:00
pfn.h libnvdimm/pfn_dev: Add page size and struct page size to pfn superblock 2019-09-05 16:11:14 -07:00
pfn_devs.c libnvdimm fixes v5.4-rc1 2019-09-29 10:33:41 -07:00
pmem.c libnvdimm/pmem: Advance namespace seed for specific probe errors 2019-09-05 16:11:14 -07:00
pmem.h libnvdimm, pmem: Restore page attributes when clearing errors 2018-08-20 09:22:45 -07:00
region.c libnvdimm/region: Initialize bad block for volatile namespaces 2019-09-24 10:27:51 -07:00
region_devs.c libnvdimm/region: Enable MAP_SYNC for volatile regions 2019-09-24 10:33:19 -07:00
security.c libnvdimm/security: ensure sysfs poll thread woke up and fetch updated attr 2020-08-21 13:05:35 +02:00
virtio_pmem.c virtio-pmem: Add virtio pmem driver 2019-07-05 15:19:10 -07:00
virtio_pmem.h virtio-pmem: Add virtio pmem driver 2019-07-05 15:19:10 -07:00