]> www.infradead.org Git - users/hch/xfstests-dev.git/commit
btrfs: add a test case to verify the write behavior of large RAID5 data chunks
authorQu Wenruo <wqu@suse.com>
Thu, 22 Jun 2023 06:54:38 +0000 (14:54 +0800)
committerZorro Lang <zlang@kernel.org>
Sun, 23 Jul 2023 04:56:22 +0000 (12:56 +0800)
commit6ca154c1b239d1e1fa9153d66272a1bf9e34c65e
treeba753c68a14b137d8ecf9e95b434b152e2ff3848
parentd28912bad3c00b3a0303d1b62fbbe97c44c578a8
btrfs: add a test case to verify the write behavior of large RAID5 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 especially nasty for RAID56, which can lead to ASSERT() during
regular writes, or corrupt memory if CONFIG_BTRFS_ASSERT is not enabled.

This is the regression test case for it.

Unlike btrfs/292, btrfs doesn't support trim inside RAID56 chunks, thus
the workflow is simplified:

- Create a RAID5 or RAID6 data chunk during mkfs

- Fill the fs with 5G data and sync
  For unpatched kernel, the sync would crash the kernel.

- Make sure everything is fine

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