lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20231003210754.275175-1-daeho43@gmail.com>
Date:   Tue,  3 Oct 2023 14:07:54 -0700
From:   Daeho Jeong <daeho43@...il.com>
To:     linux-kernel@...r.kernel.org,
        linux-f2fs-devel@...ts.sourceforge.net, kernel-team@...roid.com
Cc:     Daeho Jeong <daehojeong@...gle.com>
Subject: [PATCH] f2fs-tools: make checked node progress correct

From: Daeho Jeong <daehojeong@...gle.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@...gle.com>
---
 fsck/fsck.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

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",
-- 
2.42.0.582.g8ccd20d70d-goog

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ