Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp1545788pxb; Thu, 16 Sep 2021 09:38:11 -0700 (PDT) X-Google-Smtp-Source: ABdhPJypDuqkOxG4kXaDLr7K6Al+8ROuN48CrGtGUEJEVbmKgH4+6VIRgmVlbI6N+NubWyKRCvQL X-Received: by 2002:a05:6e02:1ca6:: with SMTP id x6mr4505841ill.86.1631810291830; Thu, 16 Sep 2021 09:38:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1631810291; cv=none; d=google.com; s=arc-20160816; b=fFutPCSFzXekaIbIwdeNNHQ8Cq8WZIvY6BG+ClrlrIJLU4WK+4ThZ9LccmJv5V7e3I fsO7/YFltTJoHom1QGJ7yIZkTPyKNfQ9pRUCPuQ0HVO/UEH43kJqYsL4vM+3t0oDn23S xuXD2HN/AtbxkTw5hQO3jCu3zrAuv4YXXrLORGpUwXWk/DmN03Iqa26bowtm0EpXvq+N 8HDoYmG9fuOklvIRixQ6VZ0lCUG9D26VQTMczNnrm/yTpRsdlUIb8dEJSQYwCVI/NtrG GvqaxxIuWWnSBmfHQWVG6QS/GYdNqbRWJtuD1Iohs/SdIL967oBqjgIrELMWtVFE19no vrSA== 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=uLfP+0pWvcRboCIX7pg5bq7N4s8smqNsbzrwdIEbYjU=; b=IrwpmwTuLhkwrSbY7K0ui9UQ4ViyelHI/bxj9hYOLPSiCImG9rk91ESW4O0xMmBxGT U/1oZBnsWy8/GGvPHREgwZyLjZG6GU4bv4ufJ98nDgf/igs8haDUUdZ986U4Fuv/YaYk gFLsqn6Ig9Zl6ZN8TaPtNcE5Nc388UH/y4sXeAZ9mNmuR1FYPgFW0Z3eAHgYpzuLWU2a byEDfCmE8ysuBsUAZh/rMw2+Q7cYU7kvGU0tncgwvdVAIWH94M3UAnAJS2cqDSbMF2Hn TjTA6a8nTdoiM0EFHht+ZMAxVF0LPzoMPpeq5TLQLxSjMLieQVcprKTRgULjZtbh6VeS GWRw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=KomuwNnB; 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 x13si3727411ilu.41.2021.09.16.09.38.00; Thu, 16 Sep 2021 09:38:11 -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=KomuwNnB; 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 S235640AbhIPQhg (ORCPT + 99 others); Thu, 16 Sep 2021 12:37:36 -0400 Received: from mail.kernel.org ([198.145.29.99]:38924 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S243166AbhIPQaH (ORCPT ); Thu, 16 Sep 2021 12:30:07 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 911056138F; Thu, 16 Sep 2021 16:18:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1631809138; bh=SBjnB2/jwGZQdtEUeDSV8Jvs09ODmXxMnqaoW1X+oEw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=KomuwNnBOBcOora04pUO7FHUuxYabz7lv5tTGefZXbpE1kEx9vLCaVQKKr3NEqh/I Q8Ricv6tz8ZELgTAthbQLdRnmoxY5nko2NyAfjk8CdsfpowhqkuZCNfQ4/qNzdv/t6 GsuDW8V8gbWz/yzKo6MqAGR9tt4ipopz/yZDDh+Y= 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.13 037/380] block: bfq: fix bfq_set_next_ioprio_data() Date: Thu, 16 Sep 2021 17:56:34 +0200 Message-Id: <20210916155805.231647872@linuxfoundation.org> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20210916155803.966362085@linuxfoundation.org> References: <20210916155803.966362085@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 @@ -5258,7 +5258,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);