linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Qu Wenruo <wqu@suse.com>
To: linux-btrfs@vger.kernel.org
Subject: [PATCH 1/2] btrfs-progs: Reduce error level from error to warning for OPEN_CTREE_PARTIAL
Date: Mon, 11 Nov 2019 15:50:58 +0800	[thread overview]
Message-ID: <20191111075059.30352-1-wqu@suse.com> (raw)

Even if we're using OPEN_CTREE_PARTIAL, like "rescue zero log", the
error message still looks too serious even we skipped that tree:

    bad tree block 2172747776, bytenr mismatch, want=2172747776, have=0
    Couldn't setup extent tree
    ^^^^^^^^^^^^^^^^^^^^^^^^^^

This patch will change the error message to:
- Use error() if we're not using OPEN_CTREE_PARTIAL
- Use warning() and explicitly show we're skipping that tree

So the result would be something like:

  For non-OPEN_CTREE_PARTIAL case:
    bad tree block 2172747776, bytenr mismatch, want=2172747776, have=0
    ERROR: could not setup extent tree

  For OPEN_CTREE_PARTIAL case
    bad tree block 2172747776, bytenr mismatch, want=2172747776, have=0
    WARNING: could not setup extent tree, skipping it

Signed-off-by: Qu Wenruo <wqu@suse.com>
---
 disk-io.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/disk-io.c b/disk-io.c
index 42f0026a6d2f..bdf63eee9bd9 100644
--- a/disk-io.c
+++ b/disk-io.c
@@ -886,9 +886,11 @@ static int setup_root_or_create_block(struct btrfs_fs_info *fs_info,
 
 	ret = find_and_setup_root(root, fs_info, objectid, info_root);
 	if (ret) {
-		printk("Couldn't setup %s tree\n", str);
-		if (!(flags & OPEN_CTREE_PARTIAL))
+		if (!(flags & OPEN_CTREE_PARTIAL)) {
+			error("could not setup %s tree", str);
 			return -EIO;
+		}
+		warning("could not setup %s tree, skipping it", str);
 		/*
 		 * Need a blank node here just so we don't screw up in the
 		 * million of places that assume a root has a valid ->node
-- 
2.24.0


             reply	other threads:[~2019-11-11  7:51 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-11-11  7:50 Qu Wenruo [this message]
2019-11-11  7:50 ` [PATCH 2/2] btrfs: rescue/zero-log: Manually write all supers to handle extent tree error more gracefully Qu Wenruo
2019-11-15 11:40   ` David Sterba

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=20191111075059.30352-1-wqu@suse.com \
    --to=wqu@suse.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).