btrfs-progs: fix stray error message in check
diff mbox series

Message ID 20190111220749.30053-1-jeffm@suse.com
State New
Headers show
Series
  • btrfs-progs: fix stray error message in check
Related show

Commit Message

Jeff Mahoney Jan. 11, 2019, 10:07 p.m. UTC
From: Jeff Mahoney <jeffm@suse.com>

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@suse.com>
---
 check/main.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Comments

David Sterba Jan. 15, 2019, 5:39 p.m. UTC | #1
On Fri, Jan 11, 2019 at 05:07:49PM -0500, jeffm@suse.com wrote:
> From: Jeff Mahoney <jeffm@suse.com>
> 
> 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@suse.com>

Applied, thanks.

Patch
diff mbox series

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);