Re: [PATCH] block/blk-cgroup-rwstat: use data_race() for online test

From: Yu Kuai

Date: Mon Aug 03 2026 - 01:33:33 EST


在 2026/8/2 23:04, Tao Cui 写道:

> From: Tao Cui<cuitao@xxxxxxxxxx>
>
> blkg_rwstat_recursive_sum() reads pos_blkg->online without the queue
> lock that its doc comment requires, since blkcg_print_blkgs() stopped
> holding it in 56cc24f59c14. Concurrent blkg_create/destroy flips
> ->online, tripping KCSAN. The race is harmless (RCU-protected, stale
> online only causes minor stat noise). Use data_race() to annotate
> the intentional lockless read.
>
> Signed-off-by: Tao Cui<cuitao@xxxxxxxxxx>
> ---
> block/blk-cgroup-rwstat.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
Reviewed-by: Yu Kuai <yukuai@xxxxxxx>

--
Thanks,
Kuai