Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

blkcg: fix incorrect read/write sync/async stat accounting

While unifying how blkcg stats are collected, 77ea733884eb ("blkcg:
move io_service_bytes and io_serviced stats into blkcg_gq")
incorrectly used bio->flags instead of bio->rw to tell the IO type.
This made IOs to be accounted as the wrong type. Fix it.

Signed-off-by: Tejun Heo <tj@kernel.org>
Fixes: 77ea733884eb ("blkcg: move io_service_bytes and io_serviced stats into blkcg_gq")
Reviewed-by: Jeff Moyer <jmoyer@redhat.com>
Signed-off-by: Jens Axboe <axboe@fb.com>

authored by

Tejun Heo and committed by
Jens Axboe
174fd8d3 858e904b

+2 -2
+2 -2
include/linux/blk-cgroup.h
··· 713 713 714 714 if (!throtl) { 715 715 blkg = blkg ?: q->root_blkg; 716 - blkg_rwstat_add(&blkg->stat_bytes, bio->bi_flags, 716 + blkg_rwstat_add(&blkg->stat_bytes, bio->bi_rw, 717 717 bio->bi_iter.bi_size); 718 - blkg_rwstat_add(&blkg->stat_ios, bio->bi_flags, 1); 718 + blkg_rwstat_add(&blkg->stat_ios, bio->bi_rw, 1); 719 719 } 720 720 721 721 rcu_read_unlock();