SMB2 and allocation size

Andreas Schneider asn at
Fri Nov 30 12:08:54 UTC 2018

On Friday, 30 November 2018 12:42:42 CET Stefan Metzmacher wrote:
> Hi Andreas,

Hi Metze,

> I'd actually like to have the server fixed.
> We need to provide the behavior of a Windows Server
> Should we only look at the block number if size != 0?

Well, if you look at vfswrap_get_alloc_size() the comment is:

  Given a stat buffer return the allocated size on disk, taking into                                                                                                  
  account sparse files.

I thought that is the reason why the size isn't taken into account at all. 
However you could just extend the if-clause and leave early. See attached ...

Ralph discovered that 'store dos attributes = yes' also results in a block 
size of 8.


Andreas Schneider                      asn at
Samba Team                   
GPG-ID:     8DFF53E18F2ABC8D8F3C92237EE0FC4DCC014E3D
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-s3-vfs-Ignore-allocation-size-for-files-which-are-em.patch
Type: text/x-patch
Size: 819 bytes
Desc: not available
URL: <>

More information about the samba-technical mailing list