Received: by 2002:a05:6358:7058:b0:131:369:b2a3 with SMTP id 24csp5170543rwp; Sun, 16 Jul 2023 21:55:18 -0700 (PDT) X-Google-Smtp-Source: APBJJlGQEasuso+whE0JtyI3YzFKOb7iCGcnYw8A6RgNsliISvnDJwkVQoSng1wafJUqo8DketGS X-Received: by 2002:a17:902:dace:b0:1b8:70d2:eb3a with SMTP id q14-20020a170902dace00b001b870d2eb3amr6549123plx.0.1689569717982; Sun, 16 Jul 2023 21:55:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1689569717; cv=none; d=google.com; s=arc-20160816; b=Y+xVGDAdYZuUlKhDhennjUpt1jzwJOtnBuEOAum+6ONCZ1Da/pQaClF2ltUvn3zXFD jieCfyPjqUjllN4QxIoTOL7BlVNFLfIhgtXqQeLIT6hpilGNJTND62+flvuqTeW0Ibah fgq8I1Ca++rkii3DK6TpQPuKp+fadnpF9zE9vlTKqaAE0ieEHjsR0dCmzrH8B9tbu8yQ s/6VbCa8sakAaC1t6jjizUtO2Syy1IlHjgzAbnHOMOQ+SOqb/roSL4ubK9QFaNqFgK07 xpQIGiIC4Cu9MXR6zZx4poP5pbjs1D+bxq2QAMCrKYV0CSy9BP48SX5St7k5uAAM7Om8 d/AQ== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=XhULMMQy5GVi2OU0Ad6+wHzsWWfxFQNSA1oYnzcztlU=; fh=o3CILnJq08Htpby3w3Eph3505qyaosLn1T+ze21qfHQ=; b=nGC18YCiQ8sB98wNQCFU7rTiKK905hlzYhQbAEmankSr7pHm8HNIATCZUi2cU2WFC4 7O3cr+lbLh86XEhonPvQhB9SbnHbPRxkpXkkvg/dnP5C79vMEjAyz71k4bL04gcqtlhL bMJPzf984q8PKmn5fIPA+w4wLpPOvALyWI8+hL5QFBsGKR4bozpr65qsPhriEITMBDWh wxjr+5Q4OZu14eKfF1GZJvB6N6nVGTMh27jelUDpzsfrMc42ZXKSaGUeosFObYRC7kqi dQZ7VsSRBcXCaDhXD6mEIcM4zxZJWYf4wuqFgSlVGSK7AdegjHQhgzFQjiTIMqQ9ea3P DeQg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b=lPOIEuBY; 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=linux.dev Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id y1-20020a1709029b8100b001b3dd62b1dbsi10904495plp.560.2023.07.16.21.55.05; Sun, 16 Jul 2023 21:55:17 -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=@linux.dev header.s=key1 header.b=lPOIEuBY; 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=linux.dev Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231169AbjGQEB7 (ORCPT + 99 others); Mon, 17 Jul 2023 00:01:59 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51078 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230435AbjGQEBw (ORCPT ); Mon, 17 Jul 2023 00:01:52 -0400 Received: from out-10.mta0.migadu.com (out-10.mta0.migadu.com [91.218.175.10]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E59BEE52 for ; Sun, 16 Jul 2023 21:01:45 -0700 (PDT) X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1689566504; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=XhULMMQy5GVi2OU0Ad6+wHzsWWfxFQNSA1oYnzcztlU=; b=lPOIEuBY1mU/WbJfF2rw4P8sXiym+C3cSXl0kNPZNRT90H6I/FvAu+UzHTynqe+69gD0KN cHfJK3HBQQC6Gh+LnCz5YdMsNCcw114I2TMNiaHhJD7j2R5/C0+sBirkICF2EV7/U3WbSe ghsduXyN6K2AawbReid6mQHSJ5U0dcM= From: chengming.zhou@linux.dev To: axboe@kernel.dk, ming.lei@redhat.com, hch@lst.de, bvanassche@acm.org Cc: linux-block@vger.kernel.org, linux-kernel@vger.kernel.org, zhouchengming@bytedance.com Subject: [PATCH v4 2/4] blk-flush: fix rq->flush.seq for post-flush requests Date: Mon, 17 Jul 2023 12:00:56 +0800 Message-ID: <20230717040058.3993930-3-chengming.zhou@linux.dev> In-Reply-To: <20230717040058.3993930-1-chengming.zhou@linux.dev> References: <20230717040058.3993930-1-chengming.zhou@linux.dev> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Migadu-Flow: FLOW_OUT X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=unavailable 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: Chengming Zhou If the policy == (REQ_FSEQ_DATA | REQ_FSEQ_POSTFLUSH), it means that the data sequence and post-flush sequence need to be done for this request. The rq->flush.seq should record what sequences have been done (or don't need to be done). So in this case, pre-flush doesn't need to be done, we should init rq->flush.seq to REQ_FSEQ_PREFLUSH not REQ_FSEQ_POSTFLUSH. Fixes: 615939a2ae73 ("blk-mq: defer to the normal submission path for post-flush requests") Signed-off-by: Chengming Zhou Reviewed-by: Christoph Hellwig --- block/blk-flush.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/block/blk-flush.c b/block/blk-flush.c index 8220517c2d67..fdc489e0ea16 100644 --- a/block/blk-flush.c +++ b/block/blk-flush.c @@ -443,7 +443,7 @@ bool blk_insert_flush(struct request *rq) * the post flush, and then just pass the command on. */ blk_rq_init_flush(rq); - rq->flush.seq |= REQ_FSEQ_POSTFLUSH; + rq->flush.seq |= REQ_FSEQ_PREFLUSH; spin_lock_irq(&fq->mq_flush_lock); list_move_tail(&rq->flush.list, &fq->flush_data_in_flight); spin_unlock_irq(&fq->mq_flush_lock); -- 2.41.0