From patchwork Sat Oct 22 07:29:41 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 7694 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4242:0:0:0:0:0 with SMTP id s2csp1109227wrr; Sat, 22 Oct 2022 01:47:38 -0700 (PDT) X-Google-Smtp-Source: AMsMyM4hJ+QK+BIlQwC3/UnKMWXO7RZEpzzQ5cV3bXl3BsS1WK5SJFwu950l5uaG6blyLws5Dyiz X-Received: by 2002:a17:906:8a66:b0:78b:da52:b752 with SMTP id hy6-20020a1709068a6600b0078bda52b752mr18849789ejc.365.1666428458157; Sat, 22 Oct 2022 01:47:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666428458; cv=none; d=google.com; s=arc-20160816; b=ncP3Db1hWg9ZuGqSJ5mTwLSqBCTgrpNRa0el2J7Guk5PNPM3aqYPTNtZJOnRK1WvOS VGE1X/fc4Zl1wl+MaLk3hzOOioaIv7Sej46RPYVLtlU7qupVxz2mMYu8OOrBJHogOUEQ lDM9LbTjyISybGhHOR4zZgfSlN3STcxojqSh+TcZHFw7f3+YgvT6JVLG9gN//f+opDwG SE/6sha1MrdToMwCS8Yk7JcHFSrjrcCVsSWGTubHSMZdJhwKal17f5eMXEABR5tvDeyl GdCuC+CRUH3Axg292Wn4kPtT7H7GL2giw7xYLXPcH16+daeuN6spA77te2GhQevMwnEu nUPQ== 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=uR+4cN0yThLbjFxIv5a7Ppl2JC2rlDTiJgqkUyEYlR9aieEtG0cmCzgz2/qVQClmox 69ibfPMNH5hdmhCgCuw/PbRp75JVQSraJsNGQB4EAREna6CNurtkncgiIA5mwkqsxhml fEHtonZdIGcTtVlzaaklJ2ZSDVZtUbW1QfQVU14XUcsOwuXn0Wr4QZBZeYa00Hnjj6o2 wYCUjsnb4cwe6rkAMA7b57WKZnEIp/o6ra85zJ4cBH00Zpj+djXDNcbSCYhaQ1XN0COM I0ZRsLpiuUfBan5P8yYD2IAotUoCxxAVNt440b3qX4m1yqPkEno3mZAhlccI1rnC0uRu +YwQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=1FEz9PqZ; 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: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id sb32-20020a1709076da000b00787bacce740si24024986ejc.537.2022.10.22.01.47.13; Sat, 22 Oct 2022 01:47:38 -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=1FEz9PqZ; 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 S234690AbiJVIqi (ORCPT + 99 others); Sat, 22 Oct 2022 04:46:38 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52858 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235014AbiJVIoP (ORCPT ); Sat, 22 Oct 2022 04:44:15 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 096E72D5EA4; Sat, 22 Oct 2022 01:07:54 -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 dfw.source.kernel.org (Postfix) with ESMTPS id 6D82760AFA; Sat, 22 Oct 2022 08:07:28 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 609DAC433D7; Sat, 22 Oct 2022 08:07:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1666426047; bh=407NwDvLPJKqzLB7rgTrwzWR7eY9drwpc2gxmRqi+5c=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=1FEz9PqZO8iy5j1LG+gfIXEkx4+ZtisPG16CpXvzqKFRIhGsKrYIWfYQyCFmu5oBf vRuJL6QLHOS+RwtonkVnIvDZr+3tbyK+18SJKcY3VC5lj9WKFYDg/NQkLhQMEAhExn vq3sLb/VAgbdaTR2PjphTIC6S8WrUH9Fb2GKsnjw= 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 5.19 702/717] blk-wbt: fix that rwb->wc is always set to 1 in wbt_init() Date: Sat, 22 Oct 2022 09:29:41 +0200 Message-Id: <20221022072529.503058251@linuxfoundation.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221022072415.034382448@linuxfoundation.org> References: <20221022072415.034382448@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 X-Spam-Status: No, score=-7.3 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1747376887236842229?= X-GMAIL-MSGID: =?utf-8?q?1747376887236842229?= 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.