From: Nikolay Borisov <nborisov@suse.com>
To: Qu Wenruo <wqu@suse.com>, linux-btrfs@vger.kernel.org
Subject: Re: [PATCH 1/2] btrfs: tree-checker: Remove comprehensive root owner check
Date: Thu, 4 Apr 2019 09:23:11 +0300 [thread overview]
Message-ID: <6a3d979f-aa45-422e-d415-0a7fbb26a06d@suse.com> (raw)
In-Reply-To: <20190404034708.3399-2-wqu@suse.com>
On 4.04.19 г. 6:47 ч., Qu Wenruo wrote:
> Commit 1ba98d086fe3 ("Btrfs: detect corruption when non-root leaf has
> zero item") introduced comprehensive root owner checker.
>
> However it's pretty expensive tree search to locate the owner root,
> especially when it get reused by mandatory read and write time
> tree-checker.
>
> This patch will remove that check, and completely rely on owner based
> empty leaf check, which is much faster and still works fine for most
> case.
>
> And since we skip the old root owner check, now write time tree check
> can be merged with btrfs_check_leaf_full().
>
> Signed-off-by: Qu Wenruo <wqu@suse.com>
This patch was sent yesterday, now it's sent again with no material
changes whatsoever? What's the point?
> ---
> fs/btrfs/tree-checker.c | 24 ------------------------
> 1 file changed, 24 deletions(-)
>
> diff --git a/fs/btrfs/tree-checker.c b/fs/btrfs/tree-checker.c
> index d2c3c1f8870d..e325d4df5c23 100644
> --- a/fs/btrfs/tree-checker.c
> +++ b/fs/btrfs/tree-checker.c
> @@ -838,7 +838,6 @@ static int check_leaf(struct extent_buffer *leaf, bool check_item_data)
> */
> if (nritems == 0 && !btrfs_header_flag(leaf, BTRFS_HEADER_FLAG_RELOC)) {
> u64 owner = btrfs_header_owner(leaf);
> - struct btrfs_root *check_root;
>
> /* These trees must never be empty */
> if (owner == BTRFS_ROOT_TREE_OBJECTID ||
> @@ -852,29 +851,6 @@ static int check_leaf(struct extent_buffer *leaf, bool check_item_data)
> owner);
> return -EUCLEAN;
> }
> - key.objectid = owner;
> - key.type = BTRFS_ROOT_ITEM_KEY;
> - key.offset = (u64)-1;
> -
> - check_root = btrfs_get_fs_root(fs_info, &key, false);
> - /*
> - * The only reason we also check NULL here is that during
> - * open_ctree() some roots has not yet been set up.
> - */
> - if (!IS_ERR_OR_NULL(check_root)) {
> - struct extent_buffer *eb;
> -
> - eb = btrfs_root_node(check_root);
> - /* if leaf is the root, then it's fine */
> - if (leaf != eb) {
> - generic_err(leaf, 0,
> - "invalid nritems, have %u should not be 0 for non-root leaf",
> - nritems);
> - free_extent_buffer(eb);
> - return -EUCLEAN;
> - }
> - free_extent_buffer(eb);
> - }
> return 0;
> }
>
>
next prev parent reply other threads:[~2019-04-04 6:23 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-04-04 3:47 [PATCH 0/2] Fixup and optimization for write time tree checker Qu Wenruo
2019-04-04 3:47 ` [PATCH 1/2] btrfs: tree-checker: Remove comprehensive root owner check Qu Wenruo
2019-04-04 6:23 ` Nikolay Borisov [this message]
2019-04-04 6:33 ` Qu Wenruo
2019-04-04 15:24 ` David Sterba
2019-04-04 3:47 ` [PATCH 2/2] btrfs: Do mandatory tree block check before submitting bio Qu Wenruo
2019-04-12 15:36 ` David Sterba
2019-04-05 15:49 ` [PATCH 0/2] Fixup and optimization for write time tree checker David Sterba
2019-04-06 0:22 ` Qu Wenruo
2019-04-06 1:57 ` Qu Wenruo
2019-04-08 22:18 ` 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=6a3d979f-aa45-422e-d415-0a7fbb26a06d@suse.com \
--to=nborisov@suse.com \
--cc=linux-btrfs@vger.kernel.org \
--cc=wqu@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).