Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp1668457pxb; Thu, 16 Sep 2021 12:29:58 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwAQ2ja2BFiNExbvPRc1b29BbZ1N8dqtR3oa+zedUeRtgt2eCPMJ6iFgZFIQAt7GoyDsTjK X-Received: by 2002:aa7:d7d5:: with SMTP id e21mr8490473eds.27.1631820597786; Thu, 16 Sep 2021 12:29:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1631820597; cv=none; d=google.com; s=arc-20160816; b=TW66GZ13E3SJPFOXxf0dDqzlMvCAXwseVF80anS9bktgyX7X4wr74ZTTWLC+8lOwfO gpggE++7AzyNRSlDZBN3r0fyYJuFmIGalPlMRESQsy0JEQNI4Tu+FYqMeSw2ME9erX8z MZy05gvS9G/Frho2KV2FMWtq2hl4Zr5FdKdcTj212lqJZy0yRkmTne9IfH8TbxMm5X1g ioxvpaxCVweRjMlG0BSbS5ujS/V28aJ7x/XcbdKql9Vm2/ERr/hW4FctGMIVGs24kTgU SlDm59/9H63cGayFDXoz8uviA8NhlNNHY6kwoRXTYSWvffVwQyHubK55dpyeJkvGY1cU kUZw== 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=NcyfUjerQ231Dd8Yek7eGQhGKcOiJoIgIxwlq0Nt+3U=; b=QD5MejQI7F3tFFfkDJQkd1lR1yZ1/PHeOQ2ucwVvwLoBA6fsMqQsxo+SdfJ5kt6+bt MMvFtIOO8W25gAJ0w1uPPouzTDPoq1vcSmq6+SThQwKjFTMVTS4CNPiC37FOPDXUxp0/ X71E/WnOeJ94EdtPEetFKmvMyQzNyZDXln5jaQQqVE+0Cg7FpPwzUjb2MrAistN2fT/p RicDS1MKtRTUHgIeELIAVg6p4QnoVZ55qZBCqiQMSK9NTZ7TdfTTbbPFTC759oRdFRwI bhX0ZNiZbG5RP4yvSbRxPp/zpe+q0yHXHXvDos3VzFfziVGA6RV73wgh9QrTuHLtL+jv HNDw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=l+65Zd5Y; 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 qt12si1788061ejb.538.2021.09.16.12.29.34; Thu, 16 Sep 2021 12:29:57 -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=l+65Zd5Y; 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 S234265AbhIPQH4 (ORCPT + 99 others); Thu, 16 Sep 2021 12:07:56 -0400 Received: from mail.kernel.org ([198.145.29.99]:45366 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240611AbhIPQGK (ORCPT ); Thu, 16 Sep 2021 12:06:10 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 3076361261; Thu, 16 Sep 2021 16:04:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1631808289; bh=hD292FD4NdtQAlFLWGGc2S5Oyv61JzF6WNbtQrAVybQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=l+65Zd5YAKQnQ2laClhvctxxB508VIPxJMkA0f40yB5KKkpxSbEn0w4XBjU+TDgIo pPqidtOevTC0BGx0ilJYftpKSkJUqdb7VzDO4C/vqUp+kJ3hT0fl8syzt1XfIa3AgF nNixg3kPI76O+znh2gtmrRW1N3pQuV1dVcEFFOLE= 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 5.10 031/306] block: bfq: fix bfq_set_next_ioprio_data() Date: Thu, 16 Sep 2021 17:56:16 +0200 Message-Id: <20210916155755.002135787@linuxfoundation.org> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20210916155753.903069397@linuxfoundation.org> References: <20210916155753.903069397@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 @@ -5011,7 +5011,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);