linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Dieter Ries <mail@dieterries.net>
To: chris.mason@fusionio.com, linux-btrfs@vger.kernel.org
Cc: Dieter Ries <mail@dieterries.net>
Subject: [PATCH 3/4] btrfs-progs: btrfsck: Print feedback about fscking to stdout.
Date: Mon,  8 Oct 2012 21:07:49 +0200	[thread overview]
Message-ID: <1349723270-12773-4-git-send-email-mail@dieterries.net> (raw)
In-Reply-To: <1349723270-12773-1-git-send-email-mail@dieterries.net>

Status reports of the checking process should be printed to stdout
instead of stderr, as that is normal program output and not related to
problems in btrfsck. This patch changes this behaviour and adds the
output "Done!" after each of the parts.

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

diff --git a/btrfsck.c b/btrfsck.c
index 516bcdf..83275cd 100644
--- a/btrfsck.c
+++ b/btrfsck.c
@@ -3559,7 +3559,7 @@ int main(int ac, char **av)
 
 	root = info->fs_root;
 
-	fprintf(stderr, "checking extents\n");
+	printf("checking extents... ");
 	if (rw)
 		trans = btrfs_start_transaction(root, 1);
 
@@ -3567,22 +3567,32 @@ int main(int ac, char **av)
 		fprintf(stderr, "Reinit crc root\n");
 		ret = btrfs_fsck_reinit_root(trans, info->csum_root);
 		if (ret) {
+			printf("\n");
 			fprintf(stderr, "crc root initialization failed\n");
 			return -EIO;
 		}
 		goto out;
 	}
 	ret = check_extents(trans, root, repair);
-	if (ret)
+	if (ret) {
 		fprintf(stderr, "Errors found in extent allocation tree\n");
+		printf("\n");
+	}
+	else
+		printf("Done!\n");
 
-	fprintf(stderr, "checking fs roots\n");
+	printf("checking fs roots... ");
 	ret = check_fs_roots(root, &root_cache);
-	if (ret)
+	if (ret) {
+		printf("\n");
 		goto out;
+	}
+	else
+		printf("Done!\n");
 
-	fprintf(stderr, "checking root refs\n");
+	printf("checking root refs... ");
 	ret = check_root_refs(root, &root_cache);
+	printf("Done!\n");
 out:
 	free_root_recs(&root_cache);
 	if (rw) {
-- 
1.7.3.GIT


  parent reply	other threads:[~2012-10-08 19:08 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-10-08 19:07 [PATCH 0/4] Resend: btrfs-progs: Some cosmetic changes (mainly) to btrfsck Dieter Ries
2012-10-08 19:07 ` [PATCH 1/4] btrfs-progs: Remove redundant "Btrfs" string from version string Dieter Ries
2012-10-08 19:07 ` [PATCH 2/4] btrfs-progs: btrfsck: Print which filesystem to be checked to stdout Dieter Ries
2012-10-09 15:08   ` David Sterba
2012-10-14 15:15     ` [PATCH 3/4] btrfs-progs: btrfsck: Print feedback about fscking " Dieter Ries
2012-10-14 15:18       ` Dieter Ries
2012-10-14 15:17     ` [PATCH 2/4] btrfs-progs: btrfsck: Print which filesystem to be checked " Dieter Ries
2012-10-08 19:07 ` Dieter Ries [this message]
2012-10-09 15:21   ` [PATCH 3/4] btrfs-progs: btrfsck: Print feedback about fscking " David Sterba
2012-10-11 20:50     ` mail
2012-10-08 19:07 ` [PATCH 4/4] btrfs-progs: btrfsck: Remove binary error code output Dieter Ries

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1349723270-12773-4-git-send-email-mail@dieterries.net \
    --to=mail@dieterries.net \
    --cc=chris.mason@fusionio.com \
    --cc=linux-btrfs@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).