projects
/
openwrt
/
staging
/
blogic.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
f0b2e56
)
libnvdimm: btt_devs: Fix locking in namespace_store
author
Axel Lin
<
[email protected]
>
Wed, 16 Sep 2015 13:24:47 +0000
(21:24 +0800)
committer
Dan Williams
<
[email protected]
>
Thu, 17 Sep 2015 15:37:16 +0000
(11:37 -0400)
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
patch
|
blob
|
history
diff --git
a/drivers/nvdimm/btt_devs.c
b/drivers/nvdimm/btt_devs.c
index 59ad54a63d9fa98fcd584a68c7dbb8a4aa863d18..cb477518dd0e4d397ede8ccc83ffe2f29ceb02a6 100644
(file)
--- a/
drivers/nvdimm/btt_devs.c
+++ b/
drivers/nvdimm/btt_devs.c
@@
-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;
}