From 3eaf19ddc83a6ab527b35a1a69b743cc98c3da90 Mon Sep 17 00:00:00 2001 From: Ksawlii Date: Sun, 24 Nov 2024 00:23:10 +0100 Subject: [PATCH] Revert "blk_iocost: fix more out of bound shifts" This reverts commit 31aab2e514c73540744f88bfd5d611a78f11b055. --- block/blk-iocost.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/block/blk-iocost.c b/block/blk-iocost.c index 7d56506eb..fe5b0c79e 100755 --- a/block/blk-iocost.c +++ b/block/blk-iocost.c @@ -2022,7 +2022,7 @@ static void ioc_forgive_debts(struct ioc *ioc, u64 usage_us_sum, int nr_debtors, struct ioc_now *now) { struct ioc_gq *iocg; - u64 dur, usage_pct, nr_cycles, nr_cycles_shift; + u64 dur, usage_pct, nr_cycles; /* if no debtor, reset the cycle */ if (!nr_debtors) { @@ -2084,12 +2084,10 @@ static void ioc_forgive_debts(struct ioc *ioc, u64 usage_us_sum, int nr_debtors, old_debt = iocg->abs_vdebt; old_delay = iocg->delay; - nr_cycles_shift = min_t(u64, nr_cycles, BITS_PER_LONG - 1); if (iocg->abs_vdebt) - iocg->abs_vdebt = iocg->abs_vdebt >> nr_cycles_shift ?: 1; - + iocg->abs_vdebt = iocg->abs_vdebt >> nr_cycles ?: 1; if (iocg->delay) - iocg->delay = iocg->delay >> nr_cycles_shift ?: 1; + iocg->delay = iocg->delay >> nr_cycles ?: 1; iocg_kick_waitq(iocg, true, now);