From: Nikolay Borisov <nborisov@suse.com>
To: Qu Wenruo <wqu@suse.com>, linux-btrfs@vger.kernel.org
Cc: dsterba@suse.cz
Subject: Re: [PATCH v2 2/3] btrfs: tree-checker: Add checker for dir item
Date: Wed, 8 Nov 2017 09:59:39 +0200 [thread overview]
Message-ID: <2ec9cf70-768f-8a77-52fe-1bf06f756f6a@suse.com> (raw)
In-Reply-To: <20171108005426.17903-3-wqu@suse.com>
On 8.11.2017 02:54, Qu Wenruo wrote:
> Add checker for dir item, for key types DIR_ITEM, DIR_INDEX and
> XATTR_ITEM.
>
> This checker does comprehensive check for:
> 1) dir_item header and its data size
> Against item boundary and maximum name/xattr length.
> This part is mostly the same as old verify_dir_item().
>
> 2) dir_type
> Against maximum file types, and against key type.
> Since XATTR key should only have FT_XATTR dir item, and normal dir
> item type should not have XATTR key.
>
> The check between key->type and dir_type is newly introduced by this
> patch.
>
> 3) name hash
> For XATTR and DIR_ITEM key, key->offset is name hash (crc32).
> Check the hash of name against key to ensure it's correct.
>
> The name hash check is only found in btrfs-progs before this patch.
>
> Signed-off-by: Qu Wenruo <wqu@suse.com>
> ---
> fs/btrfs/tree-checker.c | 141 ++++++++++++++++++++++++++++++++++++++++++++++++
> 1 file changed, 141 insertions(+)
>
I'm gonna 'hijack' this patch to discuss something - we do return the
correct EUCLEAN status from the leaf checker, however the only place
where it's called is in btree_readpage_end_io_hook and if the check
fails we only return -EIO. I wonder whether want to propagate the
EUCLEAN from there, any thoughts?
next prev parent reply other threads:[~2017-11-08 7:59 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-11-08 0:54 [PATCH v2 0/3] tree-checker bug fix and enhancement Qu Wenruo
2017-11-08 0:54 ` [PATCH v2 1/3] btrfs: tree-checker: Fix false panic for sanity test Qu Wenruo
2017-11-08 7:55 ` Nikolay Borisov
2017-11-08 8:03 ` Qu Wenruo
2017-11-15 15:43 ` David Sterba
2017-11-15 16:15 ` David Sterba
2017-11-16 22:30 ` Liu Bo
2017-11-08 0:54 ` [PATCH v2 2/3] btrfs: tree-checker: Add checker for dir item Qu Wenruo
2017-11-08 7:59 ` Nikolay Borisov [this message]
2017-11-08 8:17 ` Qu Wenruo
2017-11-16 1:57 ` Liu Bo
2017-11-15 16:15 ` David Sterba
2017-11-08 0:54 ` [PATCH v2 3/3] btrfs: Cleanup existing name_len checks Qu Wenruo
2017-11-15 16:15 ` 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=2ec9cf70-768f-8a77-52fe-1bf06f756f6a@suse.com \
--to=nborisov@suse.com \
--cc=dsterba@suse.cz \
--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).