diff options
author | Daeho Jeong <daehojeong@google.com> | 2023-10-03 14:07:54 -0700 |
---|---|---|
committer | Jaegeuk Kim <jaegeuk@kernel.org> | 2023-10-03 15:53:09 -0700 |
commit | 4d811ae0c1f1cb49b388addd56b71cbd44e2e53c (patch) | |
tree | c084466d4a6235d56b7b791a2a2d6b8bb0fbe517 | |
parent | 0baf928aa1ec9adcd6a34bcc8cdd968db70a4c98 (diff) | |
download | f2fs-tools-4d811ae0c1f1cb49b388addd56b71cbd44e2e53c.tar.gz |
f2fs-tools: make checked node progress correct
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>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
-rw-r--r-- | fsck/fsck.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/fsck/fsck.c b/fsck/fsck.c index 4dcdca6..1406aa5 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", |