Received: by 2002:a05:6358:1087:b0:cb:c9d3:cd90 with SMTP id j7csp1137376rwi; Wed, 19 Oct 2022 07:09:54 -0700 (PDT) X-Google-Smtp-Source: AMsMyM5ar31/nY5uyt0CDdRymud66258iDqOUEuOaUqQ4Ioal/un5jvo1SSzf1ZrzUZ5B4j1fFQ2 X-Received: by 2002:a17:907:3da2:b0:78d:51c4:5b80 with SMTP id he34-20020a1709073da200b0078d51c45b80mr6790607ejc.716.1666188594123; Wed, 19 Oct 2022 07:09:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666188594; cv=none; d=google.com; s=arc-20160816; b=u7+779kRLfSRCO8RxZGxa1oPO5ZVk0WI/HaegYCH2yLrqzoxcw2gYYmywR66Wroq8s xrr0EBgmGkTa2+08C8Lzn2b3gZbZ01Piusbtl78CHoRewyd0MPQOphmKE55YvrhfGwGA 8AP7nTyPgR3TA5MfQEMMHBFfmcjKXN7Vh7zaefrLpHkGvKV9WtXfMLcBRnjAQhyAsX6A JAc6ULpjtNtz91rDi0YSZ0d0fHgcC9+8XZdXqOghL/AWOiEa+cd1ULHWkiO98UMnLNGR k90vO+IuC23AnOuhX7XIBK3VuHiNfHCS7Fr4VIiz8LoMMR1FA7Au+TGFoAuLIhj/pzyi LE8w== 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=EYXui/K/o4mxhygMajTrivZ57jJQl0HpU/2o/P07m+g=; b=NJ2DaL7njSZf7SmxPEXl64dRV2w7hprjOsK7qlGFb2WTvx1piV6NGs4HC22jNwH1Ya Y3tlFgbqE3EOQD/29iJRacm+jqp5/dJDhRj3oImOJJJEu6IfyzlUphxrWyddl8ftvk6X vysPf4TFdE6anphqHqR03ZNSj/JgqhKn44EDeAk98JhEKKP8UFaRgxY/AV24JLiuyCkO jnSOJOrskqh+8ai6tK0wg3cXmlhXT3w4dwVJaM0tNMYQXZ5uBhINIMHQBxKwC4Zas1Jm e+7DJZQ4OkEe5YAfeiOfV5UKTcUTIMPL/kuxkC6UfLeTsuD2J757WONcJdNjkyYyQfLR 1Yww== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=ZxS+6Vyk; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id rs8-20020a170907036800b0078306c5c48asi11525903ejb.250.2022.10.19.07.09.28; Wed, 19 Oct 2022 07:09:54 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=ZxS+6Vyk; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 S232296AbiJSNjW (ORCPT + 99 others); Wed, 19 Oct 2022 09:39:22 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49452 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232513AbiJSNij (ORCPT ); Wed, 19 Oct 2022 09:38:39 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D218F12344A; Wed, 19 Oct 2022 06:26:24 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 2F140B824ED; Wed, 19 Oct 2022 09:16:29 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 93BCAC433C1; Wed, 19 Oct 2022 09:16:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1666170987; bh=407NwDvLPJKqzLB7rgTrwzWR7eY9drwpc2gxmRqi+5c=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ZxS+6VykgEAkOXrDLUL9mPmN5DQxuclId4GuBOBRES2FJAnbHWzCQTWKkwiMsJyAu hJSPsh+07zyI3QQyVr8m1YaTqr2pCW160dkreOh2qN577dEBRmg0NXf3uR989Bdgst AsDtdSa5N8hu/P59SwAhZJnAxEbGvA5EwLlaAlto= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, kernel test robot , Yu Kuai , Ming Lei , Jens Axboe Subject: [PATCH 6.0 851/862] blk-wbt: fix that rwb->wc is always set to 1 in wbt_init() Date: Wed, 19 Oct 2022 10:35:38 +0200 Message-Id: <20221019083327.461594272@linuxfoundation.org> X-Mailer: git-send-email 2.38.0 In-Reply-To: <20221019083249.951566199@linuxfoundation.org> References: <20221019083249.951566199@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Yu Kuai commit 285febabac4a16655372d23ff43e89ff6f216691 upstream. commit 8c5035dfbb94 ("blk-wbt: call rq_qos_add() after wb_normal is initialized") moves wbt_set_write_cache() before rq_qos_add(), which is wrong because wbt_rq_qos() is still NULL. Fix the problem by removing wbt_set_write_cache() and setting 'rwb->wc' directly. Noted that this patch also remove the redundant setting of 'rab->wc'. Fixes: 8c5035dfbb94 ("blk-wbt: call rq_qos_add() after wb_normal is initialized") Reported-by: kernel test robot Link: https://lore.kernel.org/r/202210081045.77ddf59b-yujie.liu@intel.com Signed-off-by: Yu Kuai Reviewed-by: Ming Lei Link: https://lore.kernel.org/r/20221009101038.1692875-1-yukuai1@huaweicloud.com Signed-off-by: Jens Axboe Signed-off-by: Greg Kroah-Hartman --- block/blk-wbt.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) --- a/block/blk-wbt.c +++ b/block/blk-wbt.c @@ -841,12 +841,11 @@ int wbt_init(struct request_queue *q) rwb->last_comp = rwb->last_issue = jiffies; rwb->win_nsec = RWB_WINDOW_NSEC; rwb->enable_state = WBT_STATE_ON_DEFAULT; - rwb->wc = 1; + rwb->wc = test_bit(QUEUE_FLAG_WC, &q->queue_flags); rwb->rq_depth.default_depth = RWB_DEF_DEPTH; rwb->min_lat_nsec = wbt_default_latency_nsec(q); wbt_queue_depth_changed(&rwb->rqos); - wbt_set_write_cache(q, test_bit(QUEUE_FLAG_WC, &q->queue_flags)); /* * Assign rwb and add the stats callback.