libnvdimm/bus: Stop holding nvdimm_bus_list_mutex over __nd_ioctl()
authorDan Williams <dan.j.williams@intel.com>
Thu, 18 Jul 2019 01:08:15 +0000 (18:08 -0700)
committerDan Williams <dan.j.williams@intel.com>
Thu, 18 Jul 2019 23:23:02 +0000 (16:23 -0700)
commitb70d31d054ee3a6fc1034b9d7fc0ae1e481aa018
tree91af39c84f543136ea4594ea8e9d331844dfe127
parent6de5d06e657acdbcf9637dac37916a4a5309e0f4
libnvdimm/bus: Stop holding nvdimm_bus_list_mutex over __nd_ioctl()

In preparation for fixing a deadlock between wait_for_bus_probe_idle()
and the nvdimm_bus_list_mutex arrange for __nd_ioctl() without
nvdimm_bus_list_mutex held. This also unifies the 'dimm' and 'bus' level
ioctls into a common nd_ioctl() preamble implementation.

Marked for -stable as it is a pre-requisite for a follow-on fix.

Cc: <stable@vger.kernel.org>
Fixes: bf9bccc14c05 ("libnvdimm: pmem label sets and namespace instantiation")
Cc: Vishal Verma <vishal.l.verma@intel.com>
Tested-by: Jane Chu <jane.chu@oracle.com>
Link: https://lore.kernel.org/r/156341209518.292348.7183897251740665198.stgit@dwillia2-desk3.amr.corp.intel.com
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
drivers/nvdimm/bus.c
drivers/nvdimm/nd-core.h