]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commit
libnvdimm/bus: Prepare the nd_ioctl() path to be re-entrant
authorDan Williams <dan.j.williams@intel.com>
Tue, 6 Aug 2019 01:32:07 +0000 (18:32 -0700)
committerKleber Sacilotto de Souza <kleber.souza@canonical.com>
Tue, 17 Sep 2019 16:02:18 +0000 (18:02 +0200)
commit1361dfc9df27e624d00a6d270ce9dca9ec423193
treecf0d002f29391064994a7103cb510b2d88706dca
parentb1b28852993c0395dc971682d407f679f076f796
libnvdimm/bus: Prepare the nd_ioctl() path to be re-entrant

BugLink: https://bugs.launchpad.net/bugs/1840378
commit 6de5d06e657acdbcf9637dac37916a4a5309e0f4 upstream.

In preparation for not holding a lock over the execution of nd_ioctl(),
update the implementation to allow multiple threads to be attempting
ioctls at the same time. The bus lock still prevents multiple in-flight
->ndctl() invocations from corrupting each other's state, but static
global staging buffers are moved to the heap.

Reported-by: Vishal Verma <vishal.l.verma@intel.com>
Reviewed-by: Vishal Verma <vishal.l.verma@intel.com>
Tested-by: Vishal Verma <vishal.l.verma@intel.com>
Link: https://lore.kernel.org/r/156341208947.292348.10560140326807607481.stgit@dwillia2-desk3.amr.corp.intel.com
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
drivers/nvdimm/bus.c