Thanks for writing a test for this! On Thu, Feb 04, 2021 at 03:24:26PM -0800, Boris Burkov wrote: > There are some btrfs specific fsverity scenarios that don't map > neatly onto the tests in generic/574, like holes, inline extents, > and preallocated extents. Cover those in a btrfs specific test. > > That test relies on assumptions about how the Merkle tree is stored > by ext4/f2fs which don't apply to btrfs, so we also test Merkle tree > corruption here. This could be merged by some generic abstraction. The only part of generic/574 that cares where the Merkle tree is stored is _fsv_scratch_corrupt_merkle_tree(). Couldn't that be updated to handle btrfs? > Finally, that test relies extensively on fiemap, which is currently > broken on btrfs for offsets and sizes that don't align to PAGE_SIZE, > so put a simple regular file case in this test for now, while we fix > fiemap or generalize extent lookup. fiemap is only used by _fsv_scratch_corrupt_bytes(). It just wants to know the list of extents that intersect the requested byte range. Does that really not work on btrfs if the range isn't page-aligned? - Eric