linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [RFC PATCH 0/3] Add testcase for fundamental scrub recovery
@ 2016-11-22  8:38 Qu Wenruo
  2016-11-22  8:38 ` [RFC PATCH 1/3] fstests: common: rename _require_btrfs to _require_btrfs_subcommand Qu Wenruo
                   ` (4 more replies)
  0 siblings, 5 replies; 9+ messages in thread
From: Qu Wenruo @ 2016-11-22  8:38 UTC (permalink / raw)
  To: linux-btrfs, fstests

Despite the scrub test cases in fstests, there is not even one test case
which really checked if scrub can recover data.

In fact, btrfs scrub for RAID56 will even corrupt correct data stripes.

So let's start from the needed facilities and check scrub starting from RAID1.

The main reason the patchset is RFC, is the method I take to corrupt/verify
btrfs data.

unlike other stable fs, like ext* or xfs, which has good tool to
manipulate the fs.

There used to be btrfs-corrupt-block, but it gets fewer and fewer
update, no man page nor installed by default.

Here I take the method I normally do in my scripts: use btrfs-dump-tree
(btrfs inspect-internal dump-tree) and use bash to corrupt btrfs
pinpointly.
It works quite fine for several different mount options which affects
how data lies on-disk.

But the problem is also obvious, bash script is super hard to maintain,
and there is no promise that btrfs-dump-tree output won't change.
Such change will be destructive.

But IMHO it's still worthy, or btrfs scrub may break at any time.

Qu Wenruo (3):
  fstests: common: rename _require_btrfs to _require_btrfs_subcommand
  fstests: common/ondisk.btrfs: Introduce function to get btrfs ondisk  
      info
  fstests: btrfs: Add new test case to check scrub recovery and report

 common/ondisk.btrfs | 113 ++++++++++++++++++++++++++
 common/rc           |   2 +-
 tests/btrfs/004     |   2 +-
 tests/btrfs/048     |   2 +-
 tests/btrfs/059     |   2 +-
 tests/btrfs/131     |   2 +-
 tests/btrfs/132     | 229 ++++++++++++++++++++++++++++++++++++++++++++++++++++
 tests/btrfs/132.out | 111 +++++++++++++++++++++++++
 tests/btrfs/group   |   2 +
 9 files changed, 460 insertions(+), 5 deletions(-)
 create mode 100644 common/ondisk.btrfs
 create mode 100755 tests/btrfs/132
 create mode 100644 tests/btrfs/132.out

-- 
2.7.4




^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2016-12-05  7:15 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-11-22  8:38 [RFC PATCH 0/3] Add testcase for fundamental scrub recovery Qu Wenruo
2016-11-22  8:38 ` [RFC PATCH 1/3] fstests: common: rename _require_btrfs to _require_btrfs_subcommand Qu Wenruo
2016-12-05  7:10   ` Eryu Guan
2016-11-22  8:38 ` [RFC PATCH 2/3] fstests: common/ondisk.btrfs: Introduce function to get btrfs ondisk info Qu Wenruo
2016-11-22  8:38 ` [RFC PATCH 3/3] fstests: btrfs: Add new test case to check scrub recovery and report Qu Wenruo
2016-11-28  2:50 ` [RFC PATCH 0/3] Add testcase for fundamental scrub recovery Qu Wenruo
2016-11-28  3:29   ` Eryu Guan
2016-12-05  7:07 ` Eryu Guan
2016-12-05  7:15   ` Qu Wenruo

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).