From patchwork Mon Jul 17 04:00:56 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chengming Zhou X-Patchwork-Id: 121033 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:c923:0:b0:3e4:2afc:c1 with SMTP id j3csp893585vqt; Sun, 16 Jul 2023 21:04:37 -0700 (PDT) X-Google-Smtp-Source: APBJJlG+U88Q8MRZHH4elGe8no0ng/C93Q+5j5x+WlaDEYa3zkK+W/R7YU8vH28NjsHaGDBL/z8t X-Received: by 2002:a17:907:900e:b0:982:bbc7:15c0 with SMTP id ay14-20020a170907900e00b00982bbc715c0mr8693744ejc.66.1689566677315; Sun, 16 Jul 2023 21:04:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1689566677; cv=none; d=google.com; s=arc-20160816; b=PyTDAP806HwuGwZten1dmxHt7b85IR/2aDu9hCR2RlGT3oLZCbIXqeNNjLNL/6W7hd bXFItf7gCsn/dkjFlCtwKTKho+QswYyDjjrDq2TT90V6/q7nX5ziTfkC/tazylkXNsnL ACwHIAbC5miWwRisbY2c0c25BblmRm3KbRhcl3B+f+NE90ChoNw0me0LiLIgOaL5RDCX HpcgaXL3gN8E3NbH2zQ1nxliwG+fx73f1yygmU28z2WFxqxK6hyw9DLbEGgZiP3rG0I0 Q8x+/wrFhtB0KlLdFQExIiAyIWHrLwik82Yn3vCq+wL+xBX0PB1PZ+MWpejtJWmT1tw9 aLGw== 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 Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id h15-20020a1709063c0f00b0098dfd35276esi11988036ejg.1055.2023.07.16.21.04.13; Sun, 16 Jul 2023 21:04:37 -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 S230498AbjGQEB7 (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 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 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1771639067917772445 X-GMAIL-MSGID: 1771639067917772445 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);