From: Qu Wenruo <wqu@suse.com>
To: linux-btrfs@vger.kernel.org
Cc: dsterba@suse.cz, lakshmipathi.g@gmail.com
Subject: [PATCH 0/3] tree-checker bug fix and enhancement.
Date: Mon, 6 Nov 2017 17:20:10 +0800 [thread overview]
Message-ID: <20171106092013.4465-1-wqu@suse.com> (raw)
This patchset fix a false panic introduced by tree-checker,
and then introduce dir_item checker, along with cleanups to remove
existing checkers sparsed in dir-item.
The 1st patch is a fix to address kernel panic with sanity test in btrfs.
The cause is there are several callers which call
btrfs_mark_buffer_dirty() while its data is not initialized.
(The same patch is resent along with the rest of the patchset)
Considering the number of callers and how many times btrfs_mark_buffer_dirty()
is called, the 1st patch will skip item data check, so check in
btrfs_mark_buffer_dirty() will keep the old behavior.
(Only item and item pointer overlap check is newly introduced in this case)
The 2nd patch introduce comprehensive check for dir item, which is used
for 3 key types: DIR_ITEM, DIR_INDEX and XATTR.
(Unlike previous attempts to check all items with variable length)
Except existing checks, new checks are:
1) Enhanced dir type check
Now only XATTR key can have FT_ATTR dir item.
2) name hash for DIR_ITEM/XATTR_ITEM
Original introduced in btrfs-progs for a corrupted (non-fuzzed)
image.
The last patch will cleanup the related existing code, mostly related to
verify_dir_item() and btrfs_is_name_len_valid().
Unlike btrfs_check_leaf() called in btrfs_mark_buffer_dirty(), all the
verification calls are in read path, so we won't lost any early warning
since they didn't exist from the beginning.
Qu Wenruo (3):
btrfs: tree-checker: Fix false panic for sanity test
btrfs: tree-checker: Add checker for dir item
btrfs: Cleanup existing name_len checks
fs/btrfs/ctree.h | 5 --
fs/btrfs/dir-item.c | 108 ---------------------------------
fs/btrfs/disk-io.c | 5 +-
fs/btrfs/export.c | 5 --
fs/btrfs/inode.c | 4 --
fs/btrfs/props.c | 7 ---
fs/btrfs/root-tree.c | 7 ---
fs/btrfs/send.c | 6 --
fs/btrfs/tree-checker.c | 157 ++++++++++++++++++++++++++++++++++++++++++++++--
fs/btrfs/tree-checker.h | 3 +-
fs/btrfs/tree-log.c | 47 +++------------
fs/btrfs/xattr.c | 6 --
12 files changed, 166 insertions(+), 194 deletions(-)
--
2.15.0
next reply other threads:[~2017-11-06 9:20 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-11-06 9:20 Qu Wenruo [this message]
2017-11-06 9:20 ` [PATCH 1/3] btrfs: tree-checker: Fix false panic for sanity test Qu Wenruo
2017-11-06 9:20 ` [PATCH 2/3] btrfs: tree-checker: Add checker for dir item Qu Wenruo
2017-11-06 15:41 ` Nikolay Borisov
2017-11-07 2:34 ` Su Yue
2017-11-06 9:20 ` [PATCH 3/3] btrfs: Cleanup existing name_len checks Qu Wenruo
2017-11-06 15:43 ` Nikolay Borisov
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=20171106092013.4465-1-wqu@suse.com \
--to=wqu@suse.com \
--cc=dsterba@suse.cz \
--cc=lakshmipathi.g@gmail.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).