fallocate extending file behavior and Samba

Steve French smfrench at gmail.com
Mon Aug 3 22:39:01 UTC 2020


https://bugzilla.kernel.org/show_bug.cgi?id=208775

mentioned the problem XiaoLi noted - extending a non-sparse file in
Samba doesn't allocate any disk space as would be expected.   This
behavior can be changed by "strict allocate = yes" but presumably
Samba server should report sparse files as sparse (which they would be
by default on most Linux fs).  Looking at where FILE_ATTRIBUTE_SPARSE
is returned - it doesn't seem to have anything to do with whether the
file is actually sparse (ie the blocks allocated for the file are less
than the file size).

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

-- 
Thanks,

Steve



More information about the samba-technical mailing list