fallocate extending file behavior and Samba
bj at SerNet.DE
Wed Aug 12 10:15:55 UTC 2020
On 2020-08-03 at 17:39 -0500 Steve French via samba-technical sent off:
> Perhaps more worrisome though was looking at what file_set_sparse does
> (or actually doesn't do). See source3/smbd/dosmode.c It doesn't
> appear to actually do anything (other than save the bit in an xattr) -
> ie it doesn't actually do what the user wants (which is to guarantee
> enough disk space is reserved by making the file's allocation size
> match the file size).
this is actually the correct and intended behaviour. A file on a Windows
machine is sparse only if it is set to sparse, this is that the dosmode flag is
used for in Samba. If the flag is set, the file is left sparse further on, even
if strict allocate is enabled. With extent based filesystems, enabling strict
allocate is recommended of course.
More information about the samba-technical