[Samba] 2 GB file size limit with libsmbclient and Filesys::SmbClient perl module?!

Devavrat Mittal Devavrat_Mittal at symantec.com
Mon Mar 26 01:59:47 MDT 2012


Hi,

I have a 32-bit installation of Arch Linux and I have developed my own little script (in perl) for downloading files over SMB/CIFS using multiple TCP connections to speed up the transfer. I have googled a lot but could not find any good download accelerator for files hosted over SMB/ CIFS. For example, the DownThemAll firefox add-on allows you to download files hosted over SMB/ CIFS, but is not able to speed it up using multiple parallel connections. That being the motivation for me to write my own script which splits a file into multiple chunks and downloads them in parallel.

Now, my script is written in perl and uses Filesys::SmbClient, which in turn, uses libsmbclient for SMB/ CIFS access.
Attached is my script tarball.

The problem I am facing, is that, I am unable to download files over 2GB in size!!!
I know this has to do "something" with 32-bitness and other parameters like _FILE_OFFSET_BITS=64 etc. while compiling various components, but I am out of my wits end to understand where the problem is. I have no specific 32/64 bitness in my perl script. So I assume it must be a problem either in Filesys::Smbclient or in libsmbclient itself?

My environment is as follows:


1)      Arch Linux 32 bit.

2)      Perl 32 bit (obviously)

3)      The SMB/ CIFS share is hosted on a Windows box (and not SAMBA). Everything works fine if I try to download using explorer, which means it's something in the toolchain (perl/libsmbclient) that I am using.

4)      Latest versions of everything. Perl is version 5.14, smbclient package is version 3.6.3-4, Filesys::Smbclient is version 3.1

Specifically, when I call a stat() on the file before beginning to download the file, for files over 2GB, the file size is reported as zero!
What can be the problem here?
Any advice on what can I do to troubleshoot more?
Could it be that somewhere, a 64 bit value is getting truncated to a 32 bit value, leaving the size as zero.

Thanks and Regards,
-Devavrat



More information about the samba mailing list