diff options
author | наб <nabijaczleweli@nabijaczleweli.xyz> | 2022-03-29 19:43:01 +0200 |
---|---|---|
committer | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2022-03-29 21:10:43 +0200 |
commit | d66b77b4d8be4119a5322715f58f763a872ae322 (patch) | |
tree | 63f02c0308c09b5e12c3e1bf6e95efc7bbea0c74 /src | |
parent | Merge pull request #22649 from keszybz/symlink-enablement-yet-again-punish-me... (diff) | |
download | systemd-d66b77b4d8be4119a5322715f58f763a872ae322.tar.xz systemd-d66b77b4d8be4119a5322715f58f763a872ae322.zip |
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
Diffstat (limited to 'src')
-rw-r--r-- | src/test/test-copy.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/test/test-copy.c b/src/test/test-copy.c index 71836a307e..a669df644b 100644 --- a/src/test/test-copy.c +++ b/src/test/test-copy.c @@ -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. */ |