summaryrefslogtreecommitdiff
path: root/drivers/md
diff options
context:
space:
mode:
authorMikulas Patocka <mpatocka@redhat.com>2026-01-26 15:36:22 +0100
committerSasha Levin <sashal@kernel.org>2026-03-04 07:19:46 -0500
commit0114244ec49a5fd886c00252a88310c8e4a7d8ee (patch)
treedaa4afab79180e391410ab3dbb1db0c6898658f0 /drivers/md
parentc93f23375d8c410954b0df825e814b632fd62b9d (diff)
downloadlinux-0114244ec49a5fd886c00252a88310c8e4a7d8ee.tar.gz
linux-0114244ec49a5fd886c00252a88310c8e4a7d8ee.tar.bz2
linux-0114244ec49a5fd886c00252a88310c8e4a7d8ee.zip
dm: use bio_clone_blkg_association
[ Upstream commit 2df8b310bcfe76827fd71092f58a2493ee6590b0 ] 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 ca522482e3eaf ("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: ca522482e3eaf ("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>
Diffstat (limited to 'drivers/md')
-rw-r--r--drivers/md/dm.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/md/dm.c b/drivers/md/dm.c
index f0c4c3553c01..1d03536fded0 100644
--- a/drivers/md/dm.c
+++ b/drivers/md/dm.c
@@ -1363,6 +1363,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.