From: Qu Wenruo <quwenruo@cn.fujitsu.com>
To: <dsterba@suse.cz>, Filipe David Manana <fdmanana@gmail.com>,
"linux-btrfs@vger.kernel.org" <linux-btrfs@vger.kernel.org>
Subject: Re: [PATCH 1/2] btrfs-progs: Add support for btrfs-image + corrupt script fsck test case.
Date: Tue, 16 Dec 2014 09:35:10 +0800 [thread overview]
Message-ID: <548F8C4E.4020905@cn.fujitsu.com> (raw)
In-Reply-To: <20141215181953.GT27601@twin.jikos.cz>
-------- Original Message --------
Subject: Re: [PATCH 1/2] btrfs-progs: Add support for btrfs-image +
corrupt script fsck test case.
From: David Sterba <dsterba@suse.cz>
To: Filipe David Manana <fdmanana@gmail.com>
Date: 2014年12月16日 02:19
> On Mon, Dec 15, 2014 at 10:13:45AM +0000, Filipe David Manana wrote:
>>> So another thing I would like to see is doing a more comprehensive
>>> verification that the repair code worked as expected. Currently we
>>> only check that a readonly fsck, after running fsck --repair, returns
>>> 0.
>>>
>>> For the improvements you've been doing, it's equally important to
>>> verify that --repair recovered the inodes, links, etc to the
>>> lost+found directory (or whatever is the directory's name).
>>>
>>> So perhaps adding a verify.sh script to the tarball for example?
>> Or, forgot before, it might be better to do such verification/test in
>> xfstests since we can create the fs and use the new btrfs-progs
>> programs to corrupt leafs/nodes. xfstests has a lot of infrastructure
>> already and probably run by a lot more people (compared to the fsck
>> tests of btrfs-progs).
> I'm thinking about the best way how to integrate that, but it seems that
> there will be always some level of code or infrastructure duplication
> (or other hassle).
>
> btrfs-corrupt-block is not installed by default (make install) and it's
> not a type of utility I'd consider for default installations. The tests
> would be skipped in absence of the utility, so there will be test
> environments where "install xfstests, install btrfspprogs" will not add
> the desired test coverage. Solvable by packaging the extra progs.
>
> Adding corrupt-block into xfsprogs is infeasible (IMO too much code from
> btrfs-progs to be added).
>
> I don't know how much infrastructure code we'd have to either write or
> copy from fstests, but I think it would not be that much. Ideally we
> could write the tests within btrfs-progs and then submit them to fstests
> once they're considered reliable. If we keep the same "syntax" of the
> tests, provide stubs where applicable, the code duplication in test
> itself would be zero. We'd only have to write the stubs in btrfs-progs
> and probably extend fstests to provide helpers for preparing/unpacking
> the images.
In my wildest idea, if we have a good enough btrfs debugger(maybe even
stronger than debugfs), which can
do almost everything from read key/item to corrupt given structure, then
we can resolve them all.
No binary image since corruption can be done by it and verify can also
done by it.
(OK, it's just a daydream)
But IMHO, isn't xfstests designed to mainly detect kernel defeats?
I don't see any fsck tool test case in it.
Thanks,
Qu
>
> Also, collecting the crafted binary images may bloat the git repo
> nicely, even if we use xz.
next prev parent reply other threads:[~2014-12-16 1:35 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-12-15 3:54 [PATCH 1/2] btrfs-progs: Add support for btrfs-image + corrupt script fsck test case Qu Wenruo
2014-12-15 6:09 ` Qu Wenruo
2014-12-18 17:16 ` David Sterba
2014-12-15 9:00 ` Filipe David Manana
2014-12-15 9:40 ` Qu Wenruo
2014-12-15 9:43 ` Filipe David Manana
2014-12-16 1:00 ` Qu Wenruo
2014-12-15 9:36 ` Filipe David Manana
2014-12-15 10:13 ` Filipe David Manana
2014-12-15 18:19 ` David Sterba
2014-12-16 1:35 ` Qu Wenruo [this message]
2014-12-16 14:08 ` Filipe David Manana
2014-12-24 0:03 ` Dave Chinner
2014-12-24 2:56 ` Qu Wenruo
2014-12-24 3:27 ` Dave Chinner
2014-12-15 17:35 ` David Sterba
2014-12-16 0:58 ` Qu Wenruo
2014-12-16 13:55 ` Filipe David Manana
2014-12-17 0:49 ` Qu Wenruo
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=548F8C4E.4020905@cn.fujitsu.com \
--to=quwenruo@cn.fujitsu.com \
--cc=dsterba@suse.cz \
--cc=fdmanana@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).