From patchwork Mon Jul 10 06:47:04 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chengming Zhou X-Patchwork-Id: 117674 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:9f45:0:b0:3ea:f831:8777 with SMTP id v5csp4844287vqx; Mon, 10 Jul 2023 00:27:46 -0700 (PDT) X-Google-Smtp-Source: APBJJlHs3J4iYxosdtpElsqD7LmfDqVpsbQRF12zwJika3PfXXSQLSIG7ux4AHiFMwOEjxcL/3lx X-Received: by 2002:a05:620a:2916:b0:767:3a10:d6de with SMTP id m22-20020a05620a291600b007673a10d6demr14258575qkp.58.1688974066545; Mon, 10 Jul 2023 00:27:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1688974066; cv=none; d=google.com; s=arc-20160816; b=wZLPvVpWBwDIGdq6LWCSlCo+98khr20dz065nx6fSe5DL4yWzZZLrr6btlkNcywKYK dTaqHjOlXK2TuQjLC/M6LS/RqzpQ48bw7M+R2YKPZPqJ2jdWTATdenbMq7f64bFUwSLS QOQslvfFaS1VYTWz3TpsfMwOIToIyNrc0YBBwyouveItDtixYq9+S+dME74+JRfdc2sC LZvWsGi+IyvklJaolJXHs3Kq2m3r7li9wOBHzpgSLBl4gY+hCdEfuxasLG4NoXoqbiVL upTADaAEdqsEsHMNnzdKFwGgMCTQGJ7BVTlspTR6uEAAh1bhq0+Y1Fq7ivLDTpq8gj33 J9Tw== 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 Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id k3-20020a17090a7f0300b002507cbb009bsi6701951pjl.112.2023.07.10.00.27.34; Mon, 10 Jul 2023 00:27:46 -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 S230284AbjGJGrp (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 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 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1771017670735822509 X-GMAIL-MSGID: 1771017670735822509 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 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 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);