From: Hong Zhiguo Date: Wed, 20 Nov 2013 17:35:05 +0000 (-0700) Subject: Update of blkg_stat and blkg_rwstat may happen in bh context. While u64_stats_fetch_r... X-Git-Tag: v3.10.24~23 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=950cda7f8e2bc6f182a2640817970166c55240db;p=platform%2Fkernel%2Flinux-3.10.git Update of blkg_stat and blkg_rwstat may happen in bh context. While u64_stats_fetch_retry is only preempt_disable on 32bit UP system. This is not enough to avoid preemption by bh and may read strange 64 bit value. commit 2c575026fae6e63771bd2a4c1d407214a8096a89 upstream. Signed-off-by: Hong Zhiguo Acked-by: Tejun Heo Signed-off-by: Jens Axboe Signed-off-by: Greg Kroah-Hartman --- diff --git a/block/blk-cgroup.h b/block/blk-cgroup.h index 4e595ee..749afad 100644 --- a/block/blk-cgroup.h +++ b/block/blk-cgroup.h @@ -399,9 +399,9 @@ static inline uint64_t blkg_stat_read(struct blkg_stat *stat) uint64_t v; do { - start = u64_stats_fetch_begin(&stat->syncp); + start = u64_stats_fetch_begin_bh(&stat->syncp); v = stat->cnt; - } while (u64_stats_fetch_retry(&stat->syncp, start)); + } while (u64_stats_fetch_retry_bh(&stat->syncp, start)); return v; } @@ -467,9 +467,9 @@ static inline struct blkg_rwstat blkg_rwstat_read(struct blkg_rwstat *rwstat) struct blkg_rwstat tmp; do { - start = u64_stats_fetch_begin(&rwstat->syncp); + start = u64_stats_fetch_begin_bh(&rwstat->syncp); tmp = *rwstat; - } while (u64_stats_fetch_retry(&rwstat->syncp, start)); + } while (u64_stats_fetch_retry_bh(&rwstat->syncp, start)); return tmp; }