Skip to content
/ linux Public

Commit 0114244

Browse files
Mikulas PatockaSasha Levin
authored andcommitted
dm: use bio_clone_blkg_association
[ Upstream commit 2df8b31 ] The origin bio carries blk-cgroup information which could be set from foreground(task_css(css) - wbc->wb->blkcg_css), so the blkcg won't control buffer io since commit ca52248 ("dm: pass NULL bdev to bio_alloc_clone"). The synchronous io is still under control by blkcg, because 'bio->bi_blkg' is set by io submitting task which has been added into 'cgroup.procs'. Fix it by using bio_clone_blkg_association when submitting a cloned bio. Link: https://bugzilla.kernel.org/show_bug.cgi?id=220985 Fixes: ca52248 ("dm: pass NULL bdev to bio_alloc_clone") Reported-by: Zhihao Cheng <chengzhihao1@huawei.com> Signed-off-by: Mikulas Patocka <mpatocka@redhat.com> Tested-by: Zhihao Cheng <chengzhihao1@huawei.com> Signed-off-by: Sasha Levin <sashal@kernel.org>
1 parent c93f233 commit 0114244

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

drivers/md/dm.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1363,6 +1363,8 @@ void dm_submit_bio_remap(struct bio *clone, struct bio *tgt_clone)
13631363
if (!tgt_clone)
13641364
tgt_clone = clone;
13651365

1366+
bio_clone_blkg_association(tgt_clone, io->orig_bio);
1367+
13661368
/*
13671369
* Account io->origin_bio to DM dev on behalf of target
13681370
* that took ownership of IO with DM_MAPIO_SUBMITTED.

0 commit comments

Comments
 (0)