]> git.apps.os.sepia.ceph.com Git - xfstests-dev.git/commit
btrfs: add test case for NODATASUM dev-replace v2023.02.26
authorQu Wenruo <wqu@suse.com>
Thu, 23 Feb 2023 05:10:49 +0000 (13:10 +0800)
committerZorro Lang <zlang@kernel.org>
Sat, 25 Feb 2023 14:14:01 +0000 (22:14 +0800)
commitb90914dfe3f63730b7bcfbe2300a7f6b9259c629
treec7e0dc63676f70fe74d34ce30a54bb1574dabdb6
parent744a8a6be38fb1c535624e1aca69d8187688f33a
btrfs: add test case for NODATASUM dev-replace

During my development on dev-replace, I made a mistake in RAID56
dev-replace code where it can lead to NODATASUM corruption.
Thankfully such corruption didn't reach upstream.

Inspired by such incident, here comes a new test case for btrfs
dev-replace, the new case would:

- Populate the filesystem with nodatasum mount option

- Run fssum to record the contents
  Since the test case only cares about data contents, here we don't
  include metadata like uid/gid/timestamp.

- Wipe one device

- Mount the fs with the missing device

- Verify the contents is still correct

- Replace the missing device

- Verify the contents is still correct again
  Before the verification, drop all cache to make sure the 2nd
  verification is reading from the disks.

For current kernels, the test case should pass as expected.

Signed-off-by: Qu Wenruo <wqu@suse.com>
Reviewed-by: Zorro Lang <zlang@redhat.com>
Signed-off-by: Zorro Lang <zlang@kernel.org>
tests/btrfs/286 [new file with mode: 0755]
tests/btrfs/286.out [new file with mode: 0644]