]> git.itanic.dy.fi Git - linux-stable/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)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 9 Aug 2019 15:52:28 +0000 (17:52 +0200)
commit7f000e7b44901519b41bbe6352a9fb0afc5b6d18
treeda9a30ca40cfe09d28c1be54ba2962a69c5fd591
parent3248536919c17855ef5f2bc736d9565d9580706a
libnvdimm/bus: Prepare the nd_ioctl() path to be re-entrant

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>
drivers/nvdimm/bus.c