On Thu, Oct 23, 2025 at 06:45:33PM +0200, Arsen Arsenović wrote:
"Richard W.M. Jones" <rjones(a)redhat.com> writes:
> I was definitely expecting this one to fail with ENOTSUP or similar.
> That's with the file copy-allocated-destination-zero-synch.out on ZFS?
Yes - my home directory is on ZoL, and so is ~/tmp.
It appears this is a limitation of OpenZFS:
https://github.com/openzfs/zfs/blob/fc519b2c1108b52aaad63e356645f63c2c167...
<quote>
* The original mode=0 (allocate space) behavior can be reasonably emulated
* by checking if enough space exists and creating a sparse file, as real
* persistent space reservation is not possible due to COW, snapshots, etc.
</quote>
Looking at the code when mode == 0, I believe we hit the second case
(line 707), which seems to sparsify the file and (if that succeeeds)
returns no error :-(
We should probably add a 'requires' to the test. I think it could
still be a bug in libnbd that we don't fail if fallocate fails, but it
wouldn't have helped here.
Thanks,
Rich.
--
Richard Jones, Virtualization Group, Red Hat
http://people.redhat.com/~rjones
Read my programming and virtualization blog:
http://rwmj.wordpress.com
Fedora Windows cross-compiler. Compile Windows programs, test, and
build Windows installers. Over 100 libraries supported.
http://fedoraproject.org/wiki/MinGW