]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
blk-cgroup: Fix class @block_class's subsystem refcount leakage
authorZijun Hu <quic_zijuhu@quicinc.com>
Sun, 5 Jan 2025 08:34:03 +0000 (16:34 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 13 Mar 2025 11:50:26 +0000 (12:50 +0100)
commit38287f779b34dfe959b4b681e909f2d3d52b88be
treefe1732346f5882269db4c8fc277c32104e2947cc
parent44bd016cbaa3770514b10988382ec03abd16fba8
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>
block/blk-cgroup.c