]> git-server-git.apps.pok.os.sepia.ceph.com Git - xfstests-dev.git/commit
btrfs: add test case to verify the behavior with large RAID0 data chunks
authorQu Wenruo <wqu@suse.com>
Wed, 21 Jun 2023 08:40:31 +0000 (16:40 +0800)
committerZorro Lang <zlang@kernel.org>
Fri, 7 Jul 2023 13:37:25 +0000 (21:37 +0800)
commit4ea344909abababdcbd1ccb79f4d0986dbf478c9
tree3993f918b4ed849f8ab19d1110d9ad4e308c6f6b
parentdb7fb78fda6960c853b12ae923a0e865a401edb8
btrfs: add test case to verify the behavior with large RAID0 data chunks

There is a recent regression during v6.4 merge window, that a u32 left
shift overflow can cause problems with large data chunks (over 4G
sized).

This is the regression test case for it.

The test case itself would:

- Create a RAID0 chunk with a single 6G data chunk
  This requires at least 6 devices from SCRATCH_DEV_POOL, and each
  should be larger than 2G.

- Fill the fs with 5G data

- Make sure everything is fine
  Including the data csums.

- Delete half of the data

- Do a fstrim
  This would lead to out-of-boundary trim if the kernel is not patched.

- Make sure everything is fine again
  If not patched, we may have corrupted data due to the bad fstrim
  above.

For now, this test case only checks the behavior for RAID0.
As for RAID10, we need 12 devices, which is out-of-reach for a lot of
test envionrments.

For RAID56, they would have a different test case, as they don't support
discard inside the RAID56 chunks.

Signed-off-by: Qu Wenruo <wqu@suse.com>
Reviewed-by: Anand Jain <anand.jain@oracle.com>
Reviewed-by: Filipe Manana <fdmanana@suse.com>
Signed-off-by: Zorro Lang <zlang@kernel.org>
tests/btrfs/292 [new file with mode: 0755]
tests/btrfs/292.out [new file with mode: 0644]