linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Tejun Heo <tj@kernel.org>
To: Li Jinlin <lijinlin3@huawei.com>
Cc: josef@toxicpanda.com, axboe@kernel.dk, cgroups@vger.kernel.org,
	linux-block@vger.kernel.org, linux-kernel@vger.kernel.org,
	liuzhiqiang26@huawei.com
Subject: Re: [PATCH] blk-iocost: fix shift-out-of-bounds in iocg_hick_delay()
Date: Mon, 28 Nov 2022 07:09:01 -1000	[thread overview]
Message-ID: <Y4TrLfOj5sTpXyYR@slm.duckdns.org> (raw)
In-Reply-To: <20221126121458.3564942-1-lijinlin3@huawei.com>

On Sat, Nov 26, 2022 at 08:14:58PM +0800, Li Jinlin wrote:
>  	if (iocg->delay)
> -		delay = iocg->delay >> div64_u64(tdelta, USEC_PER_SEC);
> +		delay = iocg->delay >> min(div64_u64(tdelta, USEC_PER_SEC), 63);

Let's just set delay to 0 if the shift is too big.

Thanks.

-- 
tejun

      parent reply	other threads:[~2022-11-28 17:10 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-26 12:14 [PATCH] blk-iocost: fix shift-out-of-bounds in iocg_hick_delay() Li Jinlin
2022-11-27  6:38 ` kernel test robot
2022-11-28 17:09 ` Tejun Heo [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=Y4TrLfOj5sTpXyYR@slm.duckdns.org \
    --to=tj@kernel.org \
    --cc=axboe@kernel.dk \
    --cc=cgroups@vger.kernel.org \
    --cc=josef@toxicpanda.com \
    --cc=lijinlin3@huawei.com \
    --cc=linux-block@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=liuzhiqiang26@huawei.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).