Message ID | 20231003210754.275175-1-daeho43@gmail.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:612c:2a8e:b0:403:3b70:6f57 with SMTP id in14csp2352452vqb; Tue, 3 Oct 2023 14:08:17 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHK0FS/S6kjHlSVqImJ/HOXTwMkABWsyKjmtnL/U2C6qo6tMBT8KDKQkMX8hGl56bOs2RWP X-Received: by 2002:a05:6a00:2315:b0:692:780a:de89 with SMTP id h21-20020a056a00231500b00692780ade89mr799697pfh.33.1696367297451; Tue, 03 Oct 2023 14:08:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696367297; cv=none; d=google.com; s=arc-20160816; b=nvi52FRaO9+4z41mRwx0FYycHevjZXzQV2Il2j13ptuLiQlIGryh+ioMRrctrl9BIK 9JJlAGG/pk0dxhJBKZMjihXBA3xOHb6mQ9TvmJe2P3jfn5atM1xMh5G+PdqXbFugbsdy BT1tXrBMnsBnpWo/oTE8H+M79Lgmi6Uxik4OLo1pN5okPNoe4qcnkxfghq/VWePXU8m5 7kDb/OUoKdyxYgkvR87cdtsvDrw6Lt67ishtDgbdokKad9vSPANTpyIf7IZPE+hA6UDl XFRNpODgHWZZ3etW+JUAFk4f1sBxBuf9mR8iWLoUO06NRmyg4TsJ9ETQdedQzZM6m5Al h3fg== 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=eP5y3XrI52G/EWwodsmSHUCB5YkZESEmXXN8PSy41u4=; fh=IvJDhn2XbJ55zxf0p/e9A+SWoPpre/ymwh9Q/MPTdCg=; b=AJarbs9/ZH5wTBy8HpuwlGHTzPVPbCoD0XYp4cmMLIvF+42HZ5xZOL3s3tT68qNLeZ 2HRmOQXzk+aSHqsYMZdFFVJE99jMmvyVSGtUCkZBae9il9HQx5v639PKAVDwgYEMEVdi EE5+H7tcaoYz1+wjYG/aYOxanPQzCVJf02KthmlF12iQQPO2SLa6TzWlCdpG0Bh3BLMm y/wYnl9xrCJAvzf7grjtjN8uLBk09a1hWNvxlBqj2ufY9YBW6qP5nE6UJtdD8iBkjyG2 MtRQdzF/7ZNRJiXiXtIOnR76AufOwaamYYaya2BS+f5L4iHl7b5idEC+b/GKpJ1O+QPE 9W3g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=idmHIXyx; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 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 agentk.vger.email (agentk.vger.email. [23.128.96.32]) by mx.google.com with ESMTPS id y12-20020a62ce0c000000b00690cd91cee7si2079841pfg.287.2023.10.03.14.08.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 03 Oct 2023 14:08:17 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) client-ip=23.128.96.32; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=idmHIXyx; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 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 agentk.vger.email (Postfix) with ESMTP id CA3C28183251; Tue, 3 Oct 2023 14:08:14 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232343AbjJCVIF (ORCPT <rfc822;chrisfriedt@gmail.com> + 17 others); Tue, 3 Oct 2023 17:08:05 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39632 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232252AbjJCVIC (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Tue, 3 Oct 2023 17:08:02 -0400 Received: from mail-pl1-x634.google.com (mail-pl1-x634.google.com [IPv6:2607:f8b0:4864:20::634]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 167DDAB for <linux-kernel@vger.kernel.org>; Tue, 3 Oct 2023 14:08:00 -0700 (PDT) Received: by mail-pl1-x634.google.com with SMTP id d9443c01a7336-1bd9b4f8e0eso10566085ad.1 for <linux-kernel@vger.kernel.org>; Tue, 03 Oct 2023 14:08:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1696367279; x=1696972079; 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=eP5y3XrI52G/EWwodsmSHUCB5YkZESEmXXN8PSy41u4=; b=idmHIXyxZOGlji01Q5Pk2DW954gjXOUkToqenRAzXHccfobPDg57FaRaMGZbt5ui81 zQwssW9Ky87NSFMVhBZUNmWMUOJO0iQb1aEeUFTeNt29XQflYu8kXPrsUh+9QBJv9002 8p9raJZSaNjPFB0hpOwIpTn7dFTjIIJPmK/VqzSvX1jQVD36/Fn49yuO3VdKPL59lP19 9dFvOlUG3f3hTma2d4us0VmHlsTTvH2pPMf0NZ+PZHOz2zrOmbsii9ytHCXy4Lx0bZvR 7VoYgi3sMCWI9M44CPR/SWK9pnEy/Y9c1Ot1z1AJvgzLxEhYtwwGnSLreaGIJ9JbLlGF C40A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1696367279; x=1696972079; 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=eP5y3XrI52G/EWwodsmSHUCB5YkZESEmXXN8PSy41u4=; b=qTRGH3Tl8vfZGox1wH1JHI6DVneKtzsMdUhGUzX0TMkgr6GH6V3YWxCzdCxcJr0oP6 tU926R4FJYi7iTHRSN4/D9IH3chGfm4w28hWtA14B9P2ylD67/sFxoZdiKjT0OHmwowJ nNGZphzmLDNVvtLPyx04tD5VNjx1NwnGU92Y2BlLxCq1+HA1xvW8VC4QgaNY95etzmYP rwBrO69cZx2ez7GIx3yyU9CTid9h5sx6fbhkrH1WIGnZECJ331b8VFcZuJECqsOTtPlZ Box7/iOq5vfDRUMX2k7Zr+D9qfjXPHzS9MBNmRtcJ1P4WGzWONafhQsuw7icEiwZgt2m W9Lg== X-Gm-Message-State: AOJu0YzQRw5JztorMVRkIMOZSE06Srm4AYlVLN2zGiE+xJL6kKdsBNav w6Rj7RrdFyvfrYtue7ykqlIi2up/KCY= X-Received: by 2002:a17:90a:348d:b0:273:e8c0:f9b with SMTP id p13-20020a17090a348d00b00273e8c00f9bmr464500pjb.15.1696367279212; Tue, 03 Oct 2023 14:07:59 -0700 (PDT) Received: from daehojeong-desktop.mtv.corp.google.com ([2620:15c:211:201:1d9:902f:6531:9779]) by smtp.gmail.com with ESMTPSA id 18-20020a17090a19d200b00278ff752eacsm21887pjj.50.2023.10.03.14.07.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 03 Oct 2023 14:07:58 -0700 (PDT) From: Daeho Jeong <daeho43@gmail.com> To: linux-kernel@vger.kernel.org, linux-f2fs-devel@lists.sourceforge.net, kernel-team@android.com Cc: Daeho Jeong <daehojeong@google.com> Subject: [PATCH] f2fs-tools: make checked node progress correct Date: Tue, 3 Oct 2023 14:07:54 -0700 Message-ID: <20231003210754.275175-1-daeho43@gmail.com> X-Mailer: git-send-email 2.42.0.582.g8ccd20d70d-goog MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-0.6 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on agentk.vger.email Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (agentk.vger.email [0.0.0.0]); Tue, 03 Oct 2023 14:08:14 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1778770035211513945 X-GMAIL-MSGID: 1778770035211513945 |
Series |
f2fs-tools: make checked node progress correct
|
|
Commit Message
Daeho Jeong
Oct. 3, 2023, 9:07 p.m. UTC
From: Daeho Jeong <daehojeong@google.com> Let's say we have 100 nodes to be checked. With post-increment of checked_node_cnt, when we reach the last node, we cannot print out 100% progress. So, go with pre-increment. Signed-off-by: Daeho Jeong <daehojeong@google.com> --- fsck/fsck.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
Comments
On 2023/10/4 5:07, Daeho Jeong wrote: > From: Daeho Jeong <daehojeong@google.com> > > Let's say we have 100 nodes to be checked. With post-increment of > checked_node_cnt, when we reach the last node, we cannot print out 100% > progress. So, go with pre-increment. > > Signed-off-by: Daeho Jeong <daehojeong@google.com> Reviewed-by: Chao Yu <chao@kernel.org> Thanks,
diff --git a/fsck/fsck.c b/fsck/fsck.c index 78ffdb6..23b9433 100644 --- a/fsck/fsck.c +++ b/fsck/fsck.c @@ -517,7 +517,7 @@ static int sanity_check_nid(struct f2fs_sb_info *sbi, u32 nid, if (!c.show_file_map && sbi->total_valid_node_count > 1000) { unsigned int p10 = sbi->total_valid_node_count / 10; - if (sbi->fsck->chk.checked_node_cnt++ % p10) + if (++sbi->fsck->chk.checked_node_cnt % p10) return 0; printf("[FSCK] Check node %"PRIu64" / %u (%.2f%%)\n",