projects
/
linux-block.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
c7fe193
)
drivers/dax: Expand lock scope to cover the use of addresses
author
Ira Weiny
<ira.weiny@intel.com>
Fri, 17 Jul 2020 07:20:50 +0000
(
00:20
-0700)
committer
Vishal Verma
<vishal.l.verma@intel.com>
Tue, 28 Jul 2020 17:50:08 +0000
(11:50 -0600)
The addition of PKS protection to dax read lock/unlock will require that
the address returned by dax_direct_access() be protected by this lock.
Correct the locking by ensuring that the use of kaddr and end_kaddr
are covered by the dax read lock/unlock.
Link:
https://lore.kernel.org/r/20200717072056.73134-12-ira.weiny@intel.com
Reviewed-by: Dan Williams <dan.j.williams@intel.com>
Signed-off-by: Ira Weiny <ira.weiny@intel.com>
Signed-off-by: Vishal Verma <vishal.l.verma@intel.com>
drivers/dax/super.c
patch
|
blob
|
blame
|
history
diff --git
a/drivers/dax/super.c
b/drivers/dax/super.c
index de0d02ec0347fd8a1a57ac91df5faea18dee2013..ec62752215e48d63f8d4db10c238ddfd5f5e840a 100644
(file)
--- a/
drivers/dax/super.c
+++ b/
drivers/dax/super.c
@@
-103,11
+103,11
@@
bool __generic_fsdax_supported(struct dax_device *dax_dev,
id = dax_read_lock();
len = dax_direct_access(dax_dev, pgoff, 1, &kaddr, &pfn);
len2 = dax_direct_access(dax_dev, pgoff_end, 1, &end_kaddr, &end_pfn);
- dax_read_unlock(id);
if (len < 1 || len2 < 1) {
pr_info("%s: error: dax access failed (%ld)\n",
bdevname(bdev, buf), len < 1 ? len : len2);
+ dax_read_unlock(id);
return false;
}
@@
-137,6
+137,7
@@
bool __generic_fsdax_supported(struct dax_device *dax_dev,
put_dev_pagemap(end_pgmap);
}
+ dax_read_unlock(id);
if (!dax_enabled) {
pr_info("%s: error: dax support not enabled\n",