diff mbox

[4/4] btrfs-progs: btrfsck: Remove binary error code output

Message ID 1349723270-12773-5-git-send-email-mail@dieterries.net (mailing list archive)
State New, archived
Headers show

Commit Message

Dieter Ries Oct. 8, 2012, 7:07 p.m. UTC
This patch changes the output after checking a filesystem. Before, the
default output was "found x bytes used err is 0", where the last integer
corresponds to the return value of check_root_refs(), which is either 1
or 0. Now this value is evaluated, and a message saying if errors were
found or not is printed.

Signed-off-by: Dieter Ries <mail@dieterries.net>
---
 btrfsck.c |    7 +++++--
 1 files changed, 5 insertions(+), 2 deletions(-)
diff mbox

Patch

diff --git a/btrfsck.c b/btrfsck.c
index 83275cd..45ce681 100644
--- a/btrfsck.c
+++ b/btrfsck.c
@@ -3613,8 +3613,11 @@  out:
 		       "backup data and re-format the FS. *\n\n");
 		ret = 1;
 	}
-	printf("found %llu bytes used err is %d\n",
-	       (unsigned long long)bytes_used, ret);
+	if (ret)
+		printf("Filesystem is damaged! One or more errors found.\n");
+	else
+		printf("Filesystem is clean! No errors found.\n");
+	printf("%llu bytes used\n",(unsigned long long)bytes_used);
 	printf("total csum bytes: %llu\n",(unsigned long long)total_csum_bytes);
 	printf("total tree bytes: %llu\n",
 	       (unsigned long long)total_btree_bytes);