Re: [PATCH 2/4] blk-throtl: don't warn in tg_drain_bios()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sat, Nov 27, 2021 at 06:10:57PM +0800, Yu Kuai wrote:
> tg_drain_bios() will iterate until throtl_rb_first() return NULL,
> don't warn in such situation.
> 
> Signed-off-by: Yu Kuai <yukuai3@xxxxxxxxxx>
> ---
>  block/blk-throttle.c | 11 ++++++-----
>  1 file changed, 6 insertions(+), 5 deletions(-)
> 
> diff --git a/block/blk-throttle.c b/block/blk-throttle.c
> index 230e300c5856..25822c88bea1 100644
> --- a/block/blk-throttle.c
> +++ b/block/blk-throttle.c
> @@ -497,12 +497,13 @@ static void throtl_pd_free(struct blkg_policy_data *pd)
>  }
>  
>  static struct throtl_grp *
> -throtl_rb_first(struct throtl_service_queue *parent_sq)
> +throtl_rb_first(struct throtl_service_queue *parent_sq, bool warn)
>  {
>  	struct rb_node *n;
>  
>  	n = rb_first_cached(&parent_sq->pending_tree);
> -	WARN_ON_ONCE(!n);
> +	if (warn)
> +		WARN_ON_ONCE(!n);
>  	if (!n)
>  		return NULL;

Just shift then WARN_ON_ONCE into the callers that care.



[Index of Archives]     [Linux RAID]     [Linux SCSI]     [Linux ATA RAID]     [IDE]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Device Mapper]

  Powered by Linux