f2fs-tools: make checked node progress correct
PATCH 1/1 f2fs-tools: make checked node progress correct
From: Daeho Jeong <[email protected]>
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 <[email protected]>
--- fsck/fsck.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
fsck/fsck.c +1 -1
@@ -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",
Signature · 1 line
2.42.0.582.g8ccd20d70d-goog
Quoted 7 lines · Daeho Jeong
From: Daeho Jeong <[email protected]>
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 <[email protected]>
Reviewed-by Chao Yu <[email protected]>
Thanks,