From: Jeff Mahoney <jeffm@xxxxxxxx>
Commit e578b59bf61 (btrfs-progs: convert strerror to implicit %m) missed
adding braces after a conditional so we will see the following message
whenever a tree block needs repair, regardless of whether repair was
successful: "Failed to repair btree: Success"
Signed-off-by: Jeff Mahoney <jeffm@xxxxxxxx>
---
check/main.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/check/main.c b/check/main.c
index db18827b..44bfac4e 100644
--- a/check/main.c
+++ b/check/main.c
@@ -3362,9 +3362,10 @@ skip_walking:
printf("Try to repair the btree for root %llu\n",
root->root_key.objectid);
ret = repair_btree(root, &corrupt_blocks);
- if (ret < 0)
+ if (ret < 0) {
errno = -ret;
fprintf(stderr, "Failed to repair btree: %m\n");
+ }
if (!ret)
printf("Btree for root %llu is fixed\n",
root->root_key.objectid);
--
2.16.4