Received: by 2002:a05:6520:4d:b0:139:a872:a4c9 with SMTP id i13csp2567697lkm; Mon, 20 Sep 2021 18:55:32 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzEgguCWjLTre8D7zZ3FZyyBQsCE5NVoTfUt2rPhCsRxK1HQx8ht/Z32+wFh2UePHOA/eQJ X-Received: by 2002:a6b:b842:: with SMTP id i63mr21067201iof.115.1632188973260; Mon, 20 Sep 2021 18:49:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1632188973; cv=none; d=google.com; s=arc-20160816; b=Gj9Up1MS9cA5dykUtzx2flugYsFYdqSXcFxDepcdO+Sm2/CJ4WPadY1Em8jwJzRpXu Y1u1BUixKzAfcva9MoSWRUNuyWgVcVRmOjtRZX4DM8XuJucHg9iP3eSqRH1/ONNqQfjO o9G4n6GW8Ce9q667cK4xpCbkSY+Rr0uuUYnSDPDT6Fr0oZISWlmVJNxQdcjc/GS/BK9r tTAa6Qlokc+GYxEZIUznSYPK7nud33XgUCl/nsLTl1bprdUdVRo4M549HQgSfGrOWfkk MKv3Kx7Ne0FIDxfhkxbWvfJWzJ0rvCoLNWTzP4RBs7F1yHVGH20ZCn/zkFsm275r19ZA O3iw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=X9US0vkMNqmnMts/B3lxCziRT8po9ajk571kvcjmdv8=; b=LS/5v+7qdR0TDxvp+GbuMNSFPjU/CMzmyuNBIGqLa1hOrHBon7tLhz2wrjnaFCfAww IuiaCrNFepb9UUQYqTbNPvxqEajv/+R7c02X9sP8cL2d982jL5mHFAeIkCA0AHpALk7N bBBqrpTdN8bOVPANFca97jC6e6HJPwklTTD6oBRzSNOVDXezyVPhJmUV9TXe1iW0nstw QfR5dSJiLdvmakfS3j7q4gE14e7W/PmSjC+Vr6ROPCy/eiR+kKaiITo7B7Bk5loxPshw JwxsIpkPLH7IkUdbbFu0C1cAKIySWuNFxQqTAvv30OTtG0ljJQofN27UAgy7QClq3Pgs 0H7Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=kY0pdeuV; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id c25si2559310ioz.73.2021.09.20.18.49.22; Mon, 20 Sep 2021 18:49:33 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=kY0pdeuV; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1349719AbhITRxS (ORCPT + 99 others); Mon, 20 Sep 2021 13:53:18 -0400 Received: from mail.kernel.org ([198.145.29.99]:52996 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1353798AbhITRrK (ORCPT ); Mon, 20 Sep 2021 13:47:10 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id D0B7361BB1; Mon, 20 Sep 2021 17:10:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1632157844; bh=F9rDOeSXjUPuZalEeuY8vfeGttXgD2g+DrC5pRBD83M=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=kY0pdeuV69r4X8pD7u1fNTXMsIeylQCae4TMn8EnF1+WnYK+57NMi87UBIYo1wzNS AyAkC4aTPtadhir8awiCTE2Bw/27xhAmXKdxfzazLumF0QMZn38vzZADCJfiAhxWDi Ac0BkUqfTWZnTt8AF299LfNFQavz5EFR8E02CEHY= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Damien Le Moal , Hannes Reinecke , Jens Axboe Subject: [PATCH 4.19 144/293] block: bfq: fix bfq_set_next_ioprio_data() Date: Mon, 20 Sep 2021 18:41:46 +0200 Message-Id: <20210920163938.210294242@linuxfoundation.org> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20210920163933.258815435@linuxfoundation.org> References: <20210920163933.258815435@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Damien Le Moal commit a680dd72ec336b81511e3bff48efac6dbfa563e7 upstream. For a request that has a priority level equal to or larger than IOPRIO_BE_NR, bfq_set_next_ioprio_data() prints a critical warning but defaults to setting the request new_ioprio field to IOPRIO_BE_NR. This is not consistent with the warning and the allowed values for priority levels. Fix this by setting the request new_ioprio field to IOPRIO_BE_NR - 1, the lowest priority level allowed. Cc: Fixes: aee69d78dec0 ("block, bfq: introduce the BFQ-v0 I/O scheduler as an extra scheduler") Signed-off-by: Damien Le Moal Reviewed-by: Hannes Reinecke Link: https://lore.kernel.org/r/20210811033702.368488-2-damien.lemoal@wdc.com Signed-off-by: Jens Axboe Signed-off-by: Greg Kroah-Hartman --- block/bfq-iosched.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/block/bfq-iosched.c +++ b/block/bfq-iosched.c @@ -4241,7 +4241,7 @@ bfq_set_next_ioprio_data(struct bfq_queu if (bfqq->new_ioprio >= IOPRIO_BE_NR) { pr_crit("bfq_set_next_ioprio_data: new_ioprio %d\n", bfqq->new_ioprio); - bfqq->new_ioprio = IOPRIO_BE_NR; + bfqq->new_ioprio = IOPRIO_BE_NR - 1; } bfqq->entity.new_weight = bfq_ioprio_to_weight(bfqq->new_ioprio);