From: David Sterba <dsterba@suse.cz>
To: Nikolay Borisov <nborisov@suse.com>
Cc: linux-btrfs@vger.kernel.org
Subject: Re: [PATCH v2] btrfs: Rework error detection in init_tree_roots
Date: Thu, 27 Aug 2020 14:37:03 +0200 [thread overview]
Message-ID: <20200827123703.GM28318@twin.jikos.cz> (raw)
In-Reply-To: <2f8bf44c-9c80-513f-24b2-7af4f718f527@suse.com>
On Thu, Aug 27, 2020 at 10:02:10AM +0300, Nikolay Borisov wrote:
>
>
> On 12.08.20 г. 16:16 ч., Nikolay Borisov wrote:
> > To avoid duplicating 3 lines of code the error detection logic in
> > init_tree_roots is somewhat quirky. It first checks for the presence of
> > any error condition, then checks for the specific condition to perform
> > any specific actions. That's spurious because directly checking for
> > each respective error condition and doing the necessary steps is more
> > obvious. While at it change the -EUCLEAN to -EIO in case the extent
> > buffer is not read correctly, this is in line with other sites which
> > return -EIO when the eb couldn't be read.
> >
> > Additionally it results in smaller code and the code reads
> > more linearly:
> >
> > add/remove: 0/0 grow/shrink: 0/1 up/down: 0/-95 (-95)
> > Function old new delta
> > open_ctree 17243 17148 -95
> > Total: Before=113104, After=113009, chg -0.08%
> >
> > Signed-off-by: Nikolay Borisov <nborisov@suse.com>
> > ---
> >
> > Changes in v2:
> > * Return -EIO in case of !extent_buffer_uptodate
> > * Change the error messages to distinguish both cases albeit they are still
> > rather similar.
>
> Any comments on V2 ?
Code is ok, the messages should not start with an uppercase letter,
fixed.
prev parent reply other threads:[~2020-08-27 12:39 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
2020-08-12 13:16 ` [PATCH v2] " Nikolay Borisov
2020-08-27 7:02 ` Nikolay Borisov
2020-08-27 12:37 ` David Sterba [this message]
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=20200827123703.GM28318@twin.jikos.cz \
--to=dsterba@suse.cz \
--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).