"Richard W.M. Jones" <[email protected]> writes:

> On Thu, Oct 23, 2025 at 06:45:33PM +0200, Arsen Arsenović wrote:
>> "Richard W.M. Jones" <[email protected]> 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/fc519b2c1108b52aaad63e356645f63c2c167f82/module/os/linux/zfs/zpl_file.c#L665

I figured that might be the case.  ZFS has a few instances of similar
issues.

>   <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.

A reasonable check might be to check whether a truncated file has zero
blocks, I suppose.
-- 
Arsen Arsenović

Attachment: signature.asc
Description: PGP signature

_______________________________________________
Libguestfs mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to