Received: by 2002:a05:7412:b10a:b0:f3:1519:9f41 with SMTP id az10csp2931889rdb; Mon, 4 Dec 2023 11:23:08 -0800 (PST) X-Google-Smtp-Source: AGHT+IGdisQcNoW5kXNKJpeZLrolqZGctl+19ivqTh0rbKclTRHpgBIwqSohqtI4tLgedIDSwwHF X-Received: by 2002:a17:902:dac4:b0:1d0:6ffd:e2c9 with SMTP id q4-20020a170902dac400b001d06ffde2c9mr5385866plx.99.1701717788091; Mon, 04 Dec 2023 11:23:08 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701717788; cv=none; d=google.com; s=arc-20160816; b=KDqq39FMbzalquDNFJT8GIcjGTLBfPJYKnkOVtX51LRb3JEkF6IrEf22n0yjk3idjW ZZZQPVAp+9Tu1WeKIudTPh3E7KDP1vIXsnW7vyRie/NUEDcw+Kk/7bwvRyTyke2XaLXl oyEsB8ZXGa3cl/Yv3bSt9wbuNbczKZCriNfUIfj+0cVNufSAQlR4cx7gh/yZivMIxGyP o34lchCy+dA+f8Gtow4XotkmbNx3QdE9Vgm0BmOlI4taVqzWwV9KZM0X2kubmL+frqR/ Rl9yvV/mkkeMh3b6282woLYsYizyIhOCivzjLCN4M7veIDCdwHphLd6WXFGWqlnGwlVI pXhA== 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=2NsrjOGbg4NmIjD8PWqjBsvJk5exDijeITeH9cgLNWk=; fh=IvJDhn2XbJ55zxf0p/e9A+SWoPpre/ymwh9Q/MPTdCg=; b=XUl02uLgJB90/IrVv8gBXslqWvPmnRUpNZzdIkv0U1gZXAlLJsb3fYv+GZ9BI++GAW 3IgQ56PEuS+WQcrz8BqE04FNbvbYpe+xE71PoBQ1nqCWoSFMQvZ/MCR4eS+a43QM8UJb Y+7QB5HjSN9Gg3KRXEwdw8odXfV6KZUD2MseMX7z+jf7dyCs4Qqh60nAfbxnDoA3ZO1F cRfGEaexApBtQBunx4GLvt8Fjp23J+E6P/HkcY7hHf4qzi8npaDJQSmLMBulDjL762uo U75YRAfY2HkLghcXqOUeOjiciZSNq/U3md6UxsfmfXojWNb1rPLwWhkFiZFblyTpfUj4 KTHw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b="AAcg67/j"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from snail.vger.email (snail.vger.email. [2620:137:e000::3:7]) by mx.google.com with ESMTPS id d17-20020a170903231100b001d09c96ba02si2343390plh.124.2023.12.04.11.23.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 04 Dec 2023 11:23:08 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) client-ip=2620:137:e000::3:7; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b="AAcg67/j"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id ED5AF804C552; Mon, 4 Dec 2023 11:23:06 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231368AbjLDTW5 (ORCPT + 99 others); Mon, 4 Dec 2023 14:22:57 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60606 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232466AbjLDTWz (ORCPT ); Mon, 4 Dec 2023 14:22:55 -0500 Received: from mail-pl1-x633.google.com (mail-pl1-x633.google.com [IPv6:2607:f8b0:4864:20::633]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C2FA3113 for ; Mon, 4 Dec 2023 11:22:59 -0800 (PST) Received: by mail-pl1-x633.google.com with SMTP id d9443c01a7336-1d0538d9bbcso29694955ad.3 for ; Mon, 04 Dec 2023 11:22:59 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1701717779; x=1702322579; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=2NsrjOGbg4NmIjD8PWqjBsvJk5exDijeITeH9cgLNWk=; b=AAcg67/jcfnRc4sfFu2LqcKLViC3D2sgC3j0n8L0w6K2k0aLP9twhp1HbOADmt7PzR 445gnAbwlrT6SxjW6SFEBg2SwmIOJlSPVZTcOH+imQ4Cbux8YQiEXIwlXkkdrbsjGfZU PsZIU30OFt8nHyOj+fGrc/Hlxn5L99FuM7zs6DSFqv131rmnz53tKpvT6jcUHUYPz1AZ YBoFdtujxExYQv+Rl8pXGx+0cBKmNcBTli2g0pp5XuoQZyjhkG83FhdJ21sCbBt2IdKk v6Rg5Y7uW5hgslSG7A2roeG8R6ED79+PA5aW2pZ15aTGsvhU4o7JEsWZNymsy7KxNsOI uIDQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1701717779; x=1702322579; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=2NsrjOGbg4NmIjD8PWqjBsvJk5exDijeITeH9cgLNWk=; b=U5N7IfD0KRKK1B+uVHHI6yvZO3zzRhKUvIiOTaJS+dPDvgINSG3sdUXEChO7Hj4irY iR+DdEEucU5ZIcXpi9ICw4TAdWLK/69gj2o7Xcg5jduTCBzOBxDb8hqo77PfU93bpcdI nSvAqswObIyP7ehBfD2I6+Q1sfeHqHMAdZ3vPAWEiN/6e98AQ7QD18aUNMkLXBCMdkoo 0FN7SnsztzpPYVDUQUMKDaNFfISV/BtfW3KMqU8q+0usdYSzc6eB6cb7938f59kt4DUk VMVTCUWx2S8780unXviQzA9mZTPpMfDB5r8Luw+85DIE7JH+xFEmFLncN44+MGwEePC/ ZtwA== X-Gm-Message-State: AOJu0YybyYrFrCAHnnXIokQQhrQJFdwO2FEUb+nMN5455oHXqdIqpFMP qv2uzqfz0D+3PedVZJMI/nVK4xMSSiw= X-Received: by 2002:a17:902:7842:b0:1d0:649b:89d0 with SMTP id e2-20020a170902784200b001d0649b89d0mr3912917pln.52.1701717778840; Mon, 04 Dec 2023 11:22:58 -0800 (PST) Received: from daehojeong-desktop.mtv.corp.google.com ([2620:0:1000:8411:727a:d07a:2bd2:a437]) by smtp.gmail.com with ESMTPSA id q4-20020a170902dac400b001cfe19e2508sm8687675plx.274.2023.12.04.11.22.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 04 Dec 2023 11:22:58 -0800 (PST) From: Daeho Jeong To: linux-kernel@vger.kernel.org, linux-f2fs-devel@lists.sourceforge.net, kernel-team@android.com Cc: Daeho Jeong Subject: [PATCH] f2fs-tools: skip finishing zones for current zones Date: Mon, 4 Dec 2023 11:22:51 -0800 Message-ID: <20231204192251.2518865-1-daeho43@gmail.com> X-Mailer: git-send-email 2.43.0.rc2.451.g8631bc7472-goog MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_ENVFROM_END_DIGIT, FREEMAIL_FROM,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-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (snail.vger.email [0.0.0.0]); Mon, 04 Dec 2023 11:23:07 -0800 (PST) From: Daeho Jeong Do not finishing zones for current zones. Signed-off-by: Daeho Jeong Fixes: 06a25b021d15 ("f2fs-tools: make six open zone check resilient") --- fsck/fsck.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/fsck/fsck.c b/fsck/fsck.c index 8acb822..5121a56 100644 --- a/fsck/fsck.c +++ b/fsck/fsck.c @@ -3265,8 +3265,9 @@ static int chk_and_fix_wp_with_sit(int UNUSED(i), void *blkzone, void *opaque) struct f2fs_fsck *fsck = F2FS_FSCK(sbi); block_t zone_block, wp_block, wp_blkoff; unsigned int zone_segno, wp_segno; - int ret, last_valid_blkoff; + int i, ret, last_valid_blkoff; int log_sectors_per_block = sbi->log_blocksize - SECTOR_SHIFT; + unsigned int segs_per_zone = sbi->segs_per_sec * sbi->secs_per_zone; if (blk_zone_conv(blkz)) return 0; @@ -3309,6 +3310,15 @@ static int chk_and_fix_wp_with_sit(int UNUSED(i), void *blkzone, void *opaque) return 0; } + /* if a curseg points to the zone, do not finishing zone */ + for (i = 0; i < NO_CHECK_TYPE; i++) { + struct curseg_info *cs = CURSEG_I(sbi, i); + + if (zone_segno <= cs->segno && + cs->segno < zone_segno + segs_per_zone) + return 0; + } + /* * If valid blocks exist in the zone beyond the write pointer, it * is a bug. No need to fix because the zone is not selected for the -- 2.43.0.rc2.451.g8631bc7472-goog