Commit 2c575026 authored by Hong Zhiguo's avatar Hong Zhiguo Committed by Jens Axboe

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.
Signed-off-by: default avatarHong Zhiguo <zhiguohong@tencent.com>
Acked-by: default avatarTejun Heo <tj@kernel.org>
Cc: stable@kernel.org
Signed-off-by: default avatarJens Axboe <axboe@kernel.dk>
parent 82023bb7
...@@ -435,9 +435,9 @@ static inline uint64_t blkg_stat_read(struct blkg_stat *stat) ...@@ -435,9 +435,9 @@ static inline uint64_t blkg_stat_read(struct blkg_stat *stat)
uint64_t v; uint64_t v;
do { do {
start = u64_stats_fetch_begin(&stat->syncp); start = u64_stats_fetch_begin_bh(&stat->syncp);
v = stat->cnt; v = stat->cnt;
} while (u64_stats_fetch_retry(&stat->syncp, start)); } while (u64_stats_fetch_retry_bh(&stat->syncp, start));
return v; return v;
} }
...@@ -508,9 +508,9 @@ static inline struct blkg_rwstat blkg_rwstat_read(struct blkg_rwstat *rwstat) ...@@ -508,9 +508,9 @@ static inline struct blkg_rwstat blkg_rwstat_read(struct blkg_rwstat *rwstat)
struct blkg_rwstat tmp; struct blkg_rwstat tmp;
do { do {
start = u64_stats_fetch_begin(&rwstat->syncp); start = u64_stats_fetch_begin_bh(&rwstat->syncp);
tmp = *rwstat; tmp = *rwstat;
} while (u64_stats_fetch_retry(&rwstat->syncp, start)); } while (u64_stats_fetch_retry_bh(&rwstat->syncp, start));
return tmp; return tmp;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment