From 7d96874ba80ba7a2ab578ea9139c2af79c353b88 Mon Sep 17 00:00:00 2001 From: Josef Bacik Date: Wed, 28 Oct 2026 10:41:06 -0600 Subject: [PATCH] blk-throttle: don't truncate the cgroup v1 iops limits tg_set_conf() parses the limit into a u64 and stores the iops ones through an unsigned int, so anything above UINT_MAX is truncated and a multiple of 2^32 becomes a limit of 0. The next IO of the group then divides by it in tg_within_iops_limit(). Clamp to UINT_MAX, which means no limit, like tg_set_limit() does on the default hierarchy. Fixes: af133ceb2610 ("blkcg: move blkio_group_conf->iops and ->bps to blk-throttle") Cc: Tejun Heo Signed-off-by: Josef Bacik Acked-by: Tejun Heo Link: https://patch.msgid.link/20261028164415.1262013-4-axboe@kernel.dk Signed-off-by: Jens Axboe --- block/blk-throttle.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/block/blk-throttle.c b/block/blk-throttle.c index ffc3b70065d4..4f10fe05744b 100644 --- a/block/blk-throttle.c +++ b/block/blk-throttle.c @@ -1386,7 +1386,8 @@ static ssize_t tg_set_conf(struct kernfs_open_file *of, if (is_u64) *(u64 *)((void *)tg + of_cft(of)->private) = v; else - *(unsigned int *)((void *)tg + of_cft(of)->private) = v; + *(unsigned int *)((void *)tg + of_cft(of)->private) = + min_t(u64, v, UINT_MAX); tg_conf_updated(tg, false); ret = 0;