What is max file size at Samba ?

Andrew Tridgell tridge at samba.org
Sat Jan 30 01:03:54 GMT 1999


Matti,

SMB file offsets are unsigned and can thus go to 2^32-1. Read/write
operations are not relative to a current file pointer but are instead
always relative to the start of the file. That's why a sign bit is not
needed. 

File offsets can also be 64-bits if the client and server negotiate
"large file support". Samba 2.0 supports 64-bit file offsets on some
OSes (IRIX, Solaris and a few others). We use autoconf to detect if
64-bit file offsets are available.

The really big problem is locking offsets. The SMB protocol doesn't
have any support for remote semaphores so Win32 clients use small
locks (typically 1 byte lengths) at the extreme upper end of the file
offset to simulate semaphores. These are used by _lots_ of
applications, including all OLE2 apps such as MS Office.

Unix systems have signed locking offsets in fcntl() calls so we can't
handle locks beyond 2^31. The fact that many lock daemons have broken
implementations actually means we can't actually go beyond 2^30. To
overcome this Samba currently drops 2 bits from the upper end of the
offset (bits 28 and 29) and replaces them with bits 30 and 31. This is
an ugly hack, but it does work.

The locking problem affects all file sizes, not just large files.

> I am working at Large-File-Summit stuff for Linux

is there are URL for this?

Cheers, Tridge


More information about the samba-technical mailing list