summaryrefslogtreecommitdiff
path: root/drivers/nvdimm/btt.c
diff options
context:
space:
mode:
authorDan Williams <dan.j.williams@intel.com>2017-06-30 18:56:03 -0700
committerDan Williams <dan.j.williams@intel.com>2017-06-30 18:56:03 -0700
commit6aa734a2f38e2e17ac4de3561770b8676b27af2e (patch)
tree409956203680b40ba7802c576fb02f6fab206245 /drivers/nvdimm/btt.c
parent7e5a21dfe5524a85705d3bc7b540c849cc13e9a1 (diff)
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: 975750a98c26 ("libnvdimm, pmem: Add sysfs notifications to badblocks") Cc: Toshi Kani <toshi.kani@hpe.com> Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Diffstat (limited to 'drivers/nvdimm/btt.c')
0 files changed, 0 insertions, 0 deletions