diff options
author | Hong Zhiguo <zhiguohong@tencent.com> | 2013-11-20 10:35:05 -0700 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2013-12-11 22:37:54 -0800 |
commit | 4830959318d14bd8856437ad5beea6016ef8c484 (patch) | |
tree | b145a1526ee06e4589cf7bafef4f4b0ebb31a342 | |
parent | 7b549e29197626f361f29c0a3e444259f048702f (diff) | |
download | lwn-4830959318d14bd8856437ad5beea6016ef8c484.tar.gz lwn-4830959318d14bd8856437ad5beea6016ef8c484.zip |
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 <zhiguohong@tencent.com>
Acked-by: Tejun Heo <tj@kernel.org>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r-- | block/blk-cgroup.h | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/block/blk-cgroup.h b/block/blk-cgroup.h index ae6969a7ffd4..2e34c386d760 100644 --- a/block/blk-cgroup.h +++ b/block/blk-cgroup.h @@ -430,9 +430,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; } @@ -498,9 +498,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; } |