setting allocation size in cifs/smb3

Jeremy Allison jra at samba.org
Mon Jul 21 12:55:28 MDT 2014


On Mon, Jul 21, 2014 at 01:43:12PM -0500, Steve French wrote:
> What about shrinking the file to the wrong size?

In the set allocation path info it's going through:

        if (allocation_size) {
                allocation_size = smb_roundup(conn, allocation_size);
        }

which by default uses 1MB allocation roundup values.

If you need to set the file length, set the file length :-).

It's arguable if the server can mess with allocation
requests on file shrink, but this hasn't caused a
problem in the SMB1/Windows SMB2 code paths so far,
so I'm guessing it might be allowable....

More research needed !


More information about the samba-technical mailing list