linux-next/drivers/nvdimm
Dan Williams 6aa734a2f3 libnvdimm, region, pmem: fix 'badblocks' sysfs_get_dirent() reference lifetime
We need to hold a reference on the 'dirent' until we are sure there are
no more notifications that will be sent. As noted in the new comments we
take advantage of the fact that the references are taken and dropped
under device_lock() and that nd_device_notify() holds device_lock() over
new badblocks notifications. The notifications that happen when
badblocks are cleared only occur while the device is active.

Also take the opportunity to fix up the error messages to report the
user visible effect of a sysfs_get_dirent() failure.

Fixes: 975750a98c ("libnvdimm, pmem: Add sysfs notifications to badblocks")
Cc: Toshi Kani <toshi.kani@hpe.com>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
2017-06-30 18:56:03 -07:00
..
blk.c libnvdimm: add an atomic vs process context flag to rw_bytes 2017-05-10 21:46:22 -07:00
btt_devs.c libnvdimm, btt: BTT updates for UEFI 2.7 format 2017-06-29 13:50:38 -07:00
btt.c libnvdimm, btt: fix btt_rw_page not returning errors 2017-06-29 18:24:28 -07:00
btt.h libnvdimm, btt: BTT updates for UEFI 2.7 format 2017-06-29 13:50:38 -07:00
bus.c libnvdimm, pmem: Add sysfs notifications to badblocks 2017-06-15 14:31:41 -07:00
claim.c libnvdimm: fix the clear-error check in nsio_rw_bytes 2017-06-30 18:50:34 -07:00
core.c libnvdimm, label: add address abstraction identifiers 2017-06-15 14:31:40 -07:00
dax_devs.c libnvdimm, label: add address abstraction identifiers 2017-06-15 14:31:40 -07:00
dimm_devs.c treewide: use kv[mz]alloc* rather than opencoded variants 2017-05-08 17:15:13 -07:00
dimm.c libnvdimm: handle locked label storage areas 2017-05-04 15:41:39 -07:00
e820.c libnvdimm, e820: use module_platform_driver 2016-12-05 08:52:21 -08:00
Kconfig pmem: add dax_operations support 2017-04-19 15:14:35 -07:00
label.c libnvdimm, btt: BTT updates for UEFI 2.7 format 2017-06-29 13:50:38 -07:00
label.h libnvdimm, btt: BTT updates for UEFI 2.7 format 2017-06-29 13:50:38 -07:00
Makefile libnvdimm, dax: introduce device-dax infrastructure 2016-05-09 15:35:42 -07:00
namespace_devs.c libnvdimm, btt: BTT updates for UEFI 2.7 format 2017-06-29 13:50:38 -07:00
nd-core.h libnvdimm: fix clear poison locking with spinlock and GFP_NOWAIT allocation 2017-04-13 14:23:51 -07:00
nd.h libnvdimm, btt: BTT updates for UEFI 2.7 format 2017-06-29 13:50:38 -07:00
pfn_devs.c libnvdimm, label: add address abstraction identifiers 2017-06-15 14:31:40 -07:00
pfn.h libnvdimm, dax: autodetect support 2016-05-20 22:02:57 -07:00
pmem.c libnvdimm, region, pmem: fix 'badblocks' sysfs_get_dirent() reference lifetime 2017-06-30 18:56:03 -07:00
pmem.h libnvdimm, pmem: Add sysfs notifications to badblocks 2017-06-15 14:31:41 -07:00
region_devs.c acpi, nfit: quiet invalid block-aperture-region warnings 2017-06-29 13:50:38 -07:00
region.c libnvdimm, region, pmem: fix 'badblocks' sysfs_get_dirent() reference lifetime 2017-06-30 18:56:03 -07:00