Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp34981592rwd; Mon, 10 Jul 2023 00:24:16 -0700 (PDT) X-Google-Smtp-Source: APBJJlGb9T5BjSNJS4+kv95EGMyx08H4zeSdXIMTdc2D6nOBQvudIfyriiStcNUaKgWO+Xf2sx4a X-Received: by 2002:a05:6a20:3214:b0:122:7e90:61c2 with SMTP id hl20-20020a056a20321400b001227e9061c2mr11918517pzc.9.1688973855940; Mon, 10 Jul 2023 00:24:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1688973855; cv=none; d=google.com; s=arc-20160816; b=fzw+RZVTvHJ+IRSa33RjmRzq6icdIovggJQgCOFY1rd7hBVrm7zrOoc9cf7NxJ7g8I ulqw49BsYV23OnfGveILu9nK+oHejfsAa1piY+hWRUmbKOq/j2lNLTh4RmVAR+DCsOxI hW/5kY/SYJywG1Jfpgo/UBCf6NO3HjkbCLM7GA4414V7IRBrBUTqsRdrruaR8WQ9zv3f ZgkTjdwdbPwlZM4eH4VdYk2yvQC0MgCjHNphT4xPM4zYjcH7q0EfryME0/+ZGKIr1FAW XAwRICjgo9rnvwar/7cqv8nsbCYcmw2rIKvcmIn5swg4iv9TmOMEx05Cw6Ifo1exxo79 6Pog== 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 :message-id:date:subject:cc:to:from:dkim-signature; bh=YsPE8Ph2i63iXfOKdYTTEJ0Ca9a6Ddgy8hiayl5gTk0=; fh=4fzGWvE2LW7K10hgePOrl39slR3lbqz4nggQweyfPdc=; b=kFaVlnj3yBgud0bUt/l5X3zOg580sGUHB0r9+3/tAlEC9iKnZZ8kQxyAihgOTj3Fh/ XcufCVTLchyFScUpCcoH6sdiNXn8GSsBAp4X2cbVDytEFA98UvrxL9cUfMffQHXegaHZ AwmZsOnit5AohjmA6/+XJAuPt/Y8+NS3meXu2FduTgsfTGHZgyV3XVw1urgA4HC5fcBV iYsOjVdxG6ifyw2wTo05QV6curAZG7VWsMx/tilJdH0yP7eLN9g3oWJYEohmbxmrnbzT PiUlz7kOwfwRcRI8jAQTu0TvYUV4mnDc3gKnh2CYUaO/vi7hBNt3BeWxs3mNDYvfO6cv 2LrA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b=cuhHBIOJ; 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 k4-20020a170902c40400b001b9d09004dasi4293147plk.451.2023.07.10.00.24.04; Mon, 10 Jul 2023 00:24:15 -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=cuhHBIOJ; 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 S232046AbjGJGrp (ORCPT + 99 others); Mon, 10 Jul 2023 02:47:45 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50080 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230179AbjGJGrn (ORCPT ); Mon, 10 Jul 2023 02:47:43 -0400 Received: from out-13.mta0.migadu.com (out-13.mta0.migadu.com [IPv6:2001:41d0:1004:224b::d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1DBABDF for ; Sun, 9 Jul 2023 23:47:40 -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=1688971659; 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; bh=YsPE8Ph2i63iXfOKdYTTEJ0Ca9a6Ddgy8hiayl5gTk0=; b=cuhHBIOJFOhrK+U5yrcp1YrFeAYfgbRaVbi8wFSIIzRiiGXomhszlXZtXWc7bW8MiaoKu1 H5YLR+XnbL0xBwrUoV4G2YBymHze1pRvf6IGkzG0lFOIFELKWgLKMD6LfGfZqu4ShmuHbt J1XrC5UgdJZ4fDCmyqOnFNlJYPeO3os= From: chengming.zhou@linux.dev To: axboe@kernel.dk, hch@lst.de, ming.lei@redhat.com Cc: linux-block@vger.kernel.org, linux-kernel@vger.kernel.org, zhouchengming@bytedance.com Subject: [PATCH 1/2] blk-flush: fix rq->flush.seq for post-flush requests Date: Mon, 10 Jul 2023 14:47:04 +0800 Message-ID: <20230710064705.1847287-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,RCVD_IN_DNSWL_BLOCKED, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE 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: 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. Of course, this doesn't cause any problem in fact, since pre-flush and post-flush sequence do the same thing for now. But we'd better fix this value, and the next patch will depend on this value to be correct. Signed-off-by: Chengming Zhou --- 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 4826d2d61a23..094a6adb2718 100644 --- a/block/blk-flush.c +++ b/block/blk-flush.c @@ -448,7 +448,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); fq->flush_data_in_flight++; spin_unlock_irq(&fq->mq_flush_lock); -- 2.41.0