1
0
mirror of https://github.com/systemd/systemd.git synced 2024-10-30 06:25:37 +03:00

test-copy: use non-0 data block in copy_holes

Some filesystems (e.g. zfs with compression!=off, which is the default
configuration) automatically hole-punch all-zero blocks ‒ write a block
full of ones instead
This commit is contained in:
наб 2022-03-29 19:43:01 +02:00 committed by Zbigniew Jędrzejewski-Szmek
parent 53877d0385
commit d66b77b4d8

View File

@ -343,7 +343,8 @@ TEST_RET(copy_holes) {
assert_se(fstat(fd, &stat) >= 0);
blksz = stat.st_blksize;
buf = alloca0(blksz);
buf = alloca_safe(blksz);
memset(buf, 1, blksz);
/* We need to make sure to create hole in multiples of the block size, otherwise filesystems (btrfs)
* might silently truncate/extend the holes. */