Sparse file support for SMB by default? Re: Comment about "Cygwin: sparse support: enable automatic sparsifying of files on SSDs", extend feature to VMware/qemu disks?

Corinna Vinschen corinna-cygwin@cygwin.com
Wed Dec 6 10:24:16 GMT 2023


On Dec  6 10:38, Corinna Vinschen via Cygwin wrote:
> Again, the filesystem doesn't matter.  It either sets the
> FILE_SUPPORTS_SPARSE_FILES flag or not, as simple as that.
> 
> If it does, you can create sparse files with chattr +S, or you can rely
> on the lseek/ftruncate/posix_fallocate automatism, or you stamp a hole
> into the file with fallocate(FALLOC_FL_PUNCH_HOLE).
> 
> The *only* difference is if you have to use the "sparse" mount option or
> not.
> 
> Basically, with 3.4, you always have to set the "sparse" mount option,
> with 3.5, on local SSDs you don't.  I don't see a problem here.

Oh, and to be very clear here:

This *only* affects new files or files which are not yet sparse.

As soon as a file is sparse, it stays sparse.

Subsequently, the way sparse blocks are created or converted to
allocated blocks during write, lseek, ftruncate/posix_fallocate depends
solely on how the OS and the filesystem driver perform in this matter.

Cygwin is out of the picture then.  After all, it's still just a user
space DLL.


Corinna


More information about the Cygwin mailing list