Skip to content

Commit

Permalink
blk-cgroup: cgroup_rstat_updated() shouldn't be called on cgroup1
Browse files Browse the repository at this point in the history
Currently, cgroup rstat is supported only on cgroup2 hierarchy and
rstat functions shouldn't be called on cgroup1 cgroups.  While
converting blk-cgroup core statistics to rstat, f733164
("blk-cgroup: reimplement basic IO stats using cgroup rstat")
accidentally ended up calling cgroup_rstat_updated() on cgroup1
cgroups causing crashes.

Longer term, we probably should add cgroup1 support to rstat but for
now let's mask the call directly.

Fixes: f733164 ("blk-cgroup: reimplement basic IO stats using cgroup rstat")
Tested-by: Faiz Abbas <faiz_abbas@ti.com>
Signed-off-by: Tejun Heo <tj@kernel.org>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
  • Loading branch information
Tejun Heo authored and Jens Axboe committed Nov 18, 2019
1 parent de678bc commit 496074f
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion include/linux/blk-cgroup.h
Original file line number Diff line number Diff line change
Expand Up @@ -626,7 +626,8 @@ static inline bool blkcg_bio_issue_check(struct request_queue *q,
bis->cur.ios[rwd]++;

u64_stats_update_end(&bis->sync);
cgroup_rstat_updated(blkg->blkcg->css.cgroup, cpu);
if (cgroup_subsys_on_dfl(io_cgrp_subsys))
cgroup_rstat_updated(blkg->blkcg->css.cgroup, cpu);
put_cpu();
}

Expand Down

0 comments on commit 496074f

Please sign in to comment.