Commit 2df8b310 authored by Mikulas Patocka's avatar Mikulas Patocka
Browse files

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 ca522482 ("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: ca522482 ("dm: pass NULL bdev to bio_alloc_clone")
Reported-by: default avatarZhihao Cheng <chengzhihao1@huawei.com>
Signed-off-by: default avatarMikulas Patocka <mpatocka@redhat.com>
Tested-by: default avatarZhihao Cheng <chengzhihao1@huawei.com>
parent d6d0e6b9
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -1364,6 +1364,8 @@ void dm_submit_bio_remap(struct bio *clone, struct bio *tgt_clone)
	if (!tgt_clone)
		tgt_clone = clone;

	bio_clone_blkg_association(tgt_clone, io->orig_bio);

	/*
	 * Account io->origin_bio to DM dev on behalf of target
	 * that took ownership of IO with DM_MAPIO_SUBMITTED.