2
0
mirror of https://github.com/edk2-porting/linux-next.git synced 2024-12-23 04:34:11 +08:00
linux-next/drivers/nvdimm
Jeff Moyer d08cd5e0eb libnvdimm, btt: fix uninitialized err_lock
When a sector mode namespace is initially created, the arena's err_lock
is not initialized.  If, on the other hand, the namespace already
exists, the mutex is initialized.  To fix the issue, I moved the mutex
initialization into the arena_alloc, which is called by both
discover_arenas and create_arenas.

This was discovered on an older kernel where mutex_trylock checks the
count to determine whether the lock is held.  Because the data structure
is kzalloc-d, that count was 0 (held), and I/O to the device would hang
forever waiting for the lock to be released (see btt_write_pg, for
example).  Current kernels have a different mutex implementation that
checks for a non-null owner, and so this doesn't show up as a problem.
If that lock were ever contended, it might cause issues, but you'd have
to be really unlucky, I think.

Signed-off-by: Jeff Moyer <jmoyer@redhat.com>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
2018-01-19 17:01:29 -08:00
..
badrange.c libnvdimm, badrange: remove a WARN for list_empty 2017-11-02 10:42:30 -07:00
blk.c block: guard bvec iteration logic 2017-07-03 16:56:26 -06:00
btt_devs.c libnvdimm: rename nd_sector_size_{show,store} to nd_size_select_{show,store} 2017-08-11 17:36:54 -07:00
btt.c libnvdimm, btt: fix uninitialized err_lock 2018-01-19 17:01:29 -08:00
btt.h libnvdimm, btt: rework error clearing 2017-08-31 15:05:10 -07:00
bus.c nfit, libnvdimm: deprecate the generic SMART ioctl 2017-12-04 10:19:20 -08:00
claim.c libnvdimm, btt: rework error clearing 2017-08-31 15:05:10 -07:00
core.c libnvdimm: move poison list functions to a new 'badrange' file 2017-11-02 10:42:30 -07:00
dax_devs.c Merge branch 'for-4.13/dax' into libnvdimm-for-next 2017-07-03 16:54:58 -07:00
dimm_devs.c libnvdimm: introduce 'flags' attribute for DIMM 'lock' and 'alias' status 2017-10-07 10:04:06 -07:00
dimm.c acpi, nfit: add support for the _LSI, _LSR, and _LSW label methods 2017-10-07 10:03:40 -07:00
e820.c libnvdimm, e820: use module_platform_driver 2016-12-05 08:52:21 -08:00
Kconfig treewide: Fix typos in Kconfig 2017-10-12 15:42:00 +02:00
label.c libnvdimm, namespace: fix label initialization to use valid seq numbers 2017-09-28 09:13:06 -07:00
label.h libnvdimm, btt: BTT updates for UEFI 2.7 format 2017-06-29 13:50:38 -07:00
Makefile libnvdimm for 4.15 2017-11-17 09:51:57 -08:00
namespace_devs.c libnvdimm, namespace: make a couple of functions static 2017-10-07 10:04:06 -07:00
nd-core.h libnvdimm: move poison list functions to a new 'badrange' file 2017-11-02 10:42:30 -07:00
nd.h libnvdimm: move poison list functions to a new 'badrange' file 2017-11-02 10:42:30 -07:00
pfn_devs.c libnvdimm, pfn: make 'resource' attribute only readable by root 2017-09-28 09:13:06 -07:00
pfn.h libnvdimm, dax: autodetect support 2016-05-20 22:02:57 -07:00
pmem.c bdi: introduce BDI_CAP_SYNCHRONOUS_IO 2017-11-15 18:21:02 -08:00
pmem.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
region_devs.c libnvdimm, region : make 'resource' attribute only readable by root 2017-09-28 09:13:06 -07:00
region.c libnvdimm, region, pmem: fix 'badblocks' sysfs_get_dirent() reference lifetime 2017-06-30 18:56:03 -07:00