Samba + exFAT : how to avoid pre-allocating when copying big files?

Jeremy Allison jra at samba.org
Mon Dec 7 21:52:25 UTC 2020


On Mon, Dec 07, 2020 at 04:36:00PM -0500, Joseph wrote:
>
>So two possibilities:
>
>* is there a way to set an EOF on a file descriptor on exFAT that *doesn't*
>do the allocation? This would require a modification in the exfat driver?
>
>* would it be possible to have a mode in Samba in which it never
>"truncates"?
>
>    [global]
>    no_truncate = yes
>
>The file size would grow when new data is appended when a file is copied
>(like my code in Python before, with only f.write(...)), but no truncate at
>all.
>
>Do you think this would be possible?

No. This will lead to file corruption. You could write a new VFS module
(call if vfs_exfat if you want :-) that lies to upper layers about
filesize an caches ftruncate, but this would have to catch every
stat by name as well as fstat in order to maintain the fiction.

Not a trivial bit of coding, that.



More information about the samba-technical mailing list