libnvdimm/region: Fix label activation vs errors
authorDan Williams <dan.j.williams@intel.com>
Fri, 30 Jul 2021 16:46:04 +0000 (09:46 -0700)
committerDan Williams <dan.j.williams@intel.com>
Wed, 11 Aug 2021 18:54:43 +0000 (11:54 -0700)
commitd9cee9f85b22fab88d2b76d2e92b18e3d0e6aa8c
tree4bda6335e754bdc28f93cf90c17b4ab2584ac1e8
parentb93dfa6bda4d4e88e5386490f2b277a26958f9d3
libnvdimm/region: Fix label activation vs errors

There are a few scenarios where init_active_labels() can return without
registering deactivate_labels() to run when the region is disabled. In
particular label error injection creates scenarios where a DIMM is
disabled, but labels on other DIMMs in the region become activated.

Arrange for init_active_labels() to always register deactivate_labels().

Reported-by: Krzysztof Kensicki <krzysztof.kensicki@intel.com>
Cc: <stable@vger.kernel.org>
Fixes: bf9bccc14c05 ("libnvdimm: pmem label sets and namespace instantiation.")
Reviewed-by: Jeff Moyer <jmoyer@redhat.com>
Link: https://lore.kernel.org/r/162766356450.3223041.1183118139023841447.stgit@dwillia2-desk3.amr.corp.intel.com
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
drivers/nvdimm/namespace_devs.c