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:
73f5c66
)
staging: erofs: add a full barrier in erofs_workgroup_unfreeze
author
Gao Xiang
<gaoxiang25@huawei.com>
Thu, 22 Nov 2018 17:16:03 +0000
(
01:16
+0800)
committer
Greg Kroah-Hartman
<gregkh@linuxfoundation.org>
Fri, 23 Nov 2018 09:53:08 +0000
(10:53 +0100)
Just like other generic locks, insert a full barrier
in case of memory reorder.
Reviewed-by: Chao Yu <yuchao0@huawei.com>
Signed-off-by: Gao Xiang <gaoxiang25@huawei.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/erofs/internal.h
patch
|
blob
|
history
diff --git
a/drivers/staging/erofs/internal.h
b/drivers/staging/erofs/internal.h
index 399a7003e783eabdc4d0472220a05de8a94ec629..8929443558676263eb7ed1252a02fbad22f8ee9b 100644
(file)
--- a/
drivers/staging/erofs/internal.h
+++ b/
drivers/staging/erofs/internal.h
@@
-209,6
+209,11
@@
static inline bool erofs_workgroup_try_to_freeze(struct erofs_workgroup *grp,
static inline void erofs_workgroup_unfreeze(struct erofs_workgroup *grp,
int orig_val)
{
+ /*
+ * other observers should notice all modifications
+ * in the freezing period.
+ */
+ smp_mb();
atomic_set(&grp->refcount, orig_val);
preempt_enable();
}