FAILED: patch "[PATCH] libnvdimm: btt_devs: Fix locking in namespace_store" failed to apply to 4.2-stable tree
Subsystems (3)
[email protected]
maintainerThe patch below does not apply to the 4.2-stable tree.
If someone wants it applied there, or to any other stable or longterm tree, then please email the backport, including the original git commit id to <[email protected]>.
thanks,
greg k-h
------------------ original commit in Linus's tree ------------------
Quoted 1 line
From
4be9c1fc3df9c3b03c9bde8aec5e44fc73996a3fMon Sep 17 00:00:00 2001
From: Axel Lin <[email protected]>
Date: Wed, 16 Sep 2015 21:24:47 +0800
Subject: [PATCH] libnvdimm: btt_devs: Fix locking in namespace_store
Always take device_lock() before nvdimm_bus_lock() to prevent deadlock.
Cc <[email protected]>
Signed-off-by Axel Lin <[email protected]>
Signed-off-by Dan Williams <[email protected]>
drivers/nvdimm/btt_devs.c +2 -2
@@ -128,13 +128,13 @@ static ssize_t namespace_store(struct device *dev,struct nd_btt *nd_btt =to_nd_btt (dev);ssize_t rc; -nvdimm_bus_lock (dev);device_lock (dev); +nvdimm_bus_lock (dev); rc =nd_namespace_store (dev, &nd_btt->ndns, buf, len);dev_dbg (dev,"%s: result: %zd wrote: %s%s" , __func__, rc, buf, buf[len -1 ] =='\n' ?"" :"\n" ); -device_unlock (dev);nvdimm_bus_unlock (dev); +device_unlock (dev);return rc; }