summaryrefslogtreecommitdiff
path: root/block
diff options
context:
space:
mode:
authorZijun Hu <quic_zijuhu@quicinc.com>2025-01-05 16:34:03 +0800
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2025-03-13 12:47:07 +0100
commitffb494f1e7a047bd7a41b13796fcfb08fe5beafb (patch)
tree7351ac708396223c5eff419267ce88d29070b937 /block
parentd4a35dcb964dcc00e0ba1e96b0e131a09450b8ce (diff)
downloadlinux-ffb494f1e7a047bd7a41b13796fcfb08fe5beafb.tar.gz
linux-ffb494f1e7a047bd7a41b13796fcfb08fe5beafb.tar.bz2
linux-ffb494f1e7a047bd7a41b13796fcfb08fe5beafb.zip
blk-cgroup: Fix class @block_class's subsystem refcount leakage
commit d1248436cbef1f924c04255367ff4845ccd9025e upstream. blkcg_fill_root_iostats() iterates over @block_class's devices by class_dev_iter_(init|next)(), but does not end iterating with class_dev_iter_exit(), so causes the class's subsystem refcount leakage. Fix by ending the iterating with class_dev_iter_exit(). Fixes: ef45fe470e1e ("blk-cgroup: show global disk stats in root cgroup io.stat") Reviewed-by: Michal Koutný <mkoutny@suse.com> Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Cc: stable@vger.kernel.org Acked-by: Tejun Heo <tj@kernel.org> Signed-off-by: Zijun Hu <quic_zijuhu@quicinc.com> Link: https://lore.kernel.org/r/20250105-class_fix-v6-2-3a2f1768d4d4@quicinc.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'block')
-rw-r--r--block/blk-cgroup.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/block/blk-cgroup.c b/block/blk-cgroup.c
index c623632c1cda..13a17ad646e0 100644
--- a/block/blk-cgroup.c
+++ b/block/blk-cgroup.c
@@ -851,6 +851,7 @@ static void blkcg_fill_root_iostats(void)
}
disk_put_part(part);
}
+ class_dev_iter_exit(&iter);
}
static int blkcg_print_stat(struct seq_file *sf, void *v)