Unverified Commit 39d4ff27 authored by openeuler-ci-bot's avatar openeuler-ci-bot Committed by Gitee
Browse files

!7356 blk-iocost: Fix an UBSAN shift-out-of-bounds warning

parents 55b1bcbb 121cde81
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -1315,6 +1315,13 @@ static bool iocg_kick_delay(struct ioc_gq *iocg, struct ioc_now *now)

	lockdep_assert_held(&iocg->waitq.lock);

	/*
	 * If the delay is set by another CPU, we may be in the past. No need to
	 * change anything if so. This avoids decay calculation underflow.
	 */
	if (time_before64(now->now, iocg->delay_at))
		return false;

	/* calculate the current delay in effect - 1/2 every second */
	tdelta = now->now - iocg->delay_at;
	if (iocg->delay)