Skip to content

Commit 2df8b31

Browse files
author
Mikulas Patocka
committed
dm: use bio_clone_blkg_association
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>
1 parent d6d0e6b commit 2df8b31

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

drivers/md/dm.c

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

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

0 commit comments

Comments
 (0)