If repair is enabled and try_repair_inode() failed in check_inode_recs(), then value @ret will be reset to 0 anyway. Then counter @error won't be incremented. In other words, if previous check of the root directory is fine, check_inode_recs() always returns 0 even it failed to repair inodes. So do not reset @ret after try_repair_inode(). Signed-off-by: Su Yue <suy.fnst@xxxxxxxxxxxxxx> --- Changlog: v1->v2: Add more detailed commit message. --- cmds-check.c | 1 - 1 file changed, 1 deletion(-) diff --git a/cmds-check.c b/cmds-check.c index 635c1c44ff6f..00cbc0114b22 100644 --- a/cmds-check.c +++ b/cmds-check.c @@ -3968,7 +3968,6 @@ static int check_inode_recs(struct btrfs_root *root, free_inode_rec(rec); continue; } - ret = 0; } if (!(repair && ret == 0)) -- 2.15.1 -- To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html
