linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: David Sterba <dsterba@suse.cz>
To: Nikolay Borisov <nborisov@suse.com>
Cc: Johannes Thumshirn <Johannes.Thumshirn@wdc.com>,
	"linux-btrfs@vger.kernel.org" <linux-btrfs@vger.kernel.org>
Subject: Re: [PATCH] btrfs: Rework error detection in init_tree_roots
Date: Mon, 10 Aug 2020 17:53:01 +0200	[thread overview]
Message-ID: <20200810155301.GE2026@twin.jikos.cz> (raw)
In-Reply-To: <327aaaeb-affd-e762-921d-f2f823eec3bc@suse.com>

On Tue, Aug 04, 2020 at 06:02:58PM +0300, Nikolay Borisov wrote:
> 
> 
> On 4.08.20 г. 15:58 ч., Johannes Thumshirn wrote:
> > On 04/08/2020 09:32, Nikolay Borisov wrote:
> >> @@ -2645,17 +2645,16 @@ static int __cold init_tree_roots(struct btrfs_fs_info *fs_info)
> >>  		level = btrfs_super_root_level(sb);
> >>  		tree_root->node = read_tree_block(fs_info, btrfs_super_root(sb),
> >>  						  generation, level, NULL);
> >> -		if (IS_ERR(tree_root->node) ||
> >> -		    !extent_buffer_uptodate(tree_root->node)) {
> >> +		if (IS_ERR(tree_root->node)) {
> >>  			handle_error = true;
> >> +			ret = PTR_ERR(tree_root->node);
> >> +			tree_root->node = NULL;
> >> +			btrfs_warn(fs_info, "failed to read tree root");
> >> +			continue;
> > 
> > [...]
> > 
> >>  			btrfs_warn(fs_info, "failed to read tree root");
> >>  			continue;
> >>  		}
> > 
> > Now we're duplicating the warning message. I think it's better to have two 
> > distinct messages so we can differentiate which of the two failure cases happened.
> > 
> > The 2nd one could be something like "tree root eb not uptodate".
> 
> Sure, I'm happy too replace it with whatever is more informative. Will
> take another look at the code and see what I can derive.

The errors are different, IS_ERR is because the block was not read at
all for some reason, extent_buffer_uptodate is EIO in all other places
that do this kind of check.

Here it's EUCLEAN and it's been like that since the beginning but I
think it should be EIO.

  reply	other threads:[~2020-08-10 15:54 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-08-04  7:32 [PATCH] btrfs: Rework error detection in init_tree_roots Nikolay Borisov
2020-08-04 12:58 ` Johannes Thumshirn
2020-08-04 15:02   ` Nikolay Borisov
2020-08-10 15:53     ` David Sterba [this message]
2020-08-12 13:16 ` [PATCH v2] " Nikolay Borisov
2020-08-27  7:02   ` Nikolay Borisov
2020-08-27 12:37     ` 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=20200810155301.GE2026@twin.jikos.cz \
    --to=dsterba@suse.cz \
    --cc=Johannes.Thumshirn@wdc.com \
    --cc=linux-btrfs@vger.kernel.org \
    --cc=nborisov@suse.com \
    /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).