From: Gao Xiang Date: Thu, 22 Nov 2018 17:16:03 +0000 (+0800) Subject: staging: erofs: add a full barrier in erofs_workgroup_unfreeze X-Git-Tag: v5.0-rc1~97^2~233 X-Git-Url: https://asedeno.scripts.mit.edu/gitweb/?a=commitdiff_plain;h=948bbdb1818b7ad6e539dad4fbd2dd4650793ea9;p=linux.git staging: erofs: add a full barrier in erofs_workgroup_unfreeze Just like other generic locks, insert a full barrier in case of memory reorder. Reviewed-by: Chao Yu Signed-off-by: Gao Xiang Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/staging/erofs/internal.h b/drivers/staging/erofs/internal.h index 399a7003e783..892944355867 100644 --- 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(); }