libsmbclient/smbc_opendir problem with large directories.
derrell at samba.org
derrell at samba.org
Mon Jun 12 12:50:41 GMT 2006
Henrik Zagerholm <henke at mac.se> writes:
> Hi Samba team,
>
> I'm currently coding some C++ wrapper functions around libsmbclient.c.
>
> I experience really weird results when dealing with directories with many dir
> entries ( With my setup/hardware around 2000+ )
>
> smbc_opendir returns a valid smbc_file but the dir entries are not complete
> (their names are truncated to one character)
>
> It seems to be a timeout problem because when I run my testprogram against
> the same client the problem disappears as the files get cached on the client.
> After flushing the file cache on the client the problem returns.
>
> Is there a more controllable way of getting dir entries?
> Are there more timeout variables other than context->timeout that I can
> manipulate?
>
> Setting context->timeout to high values seems to solve the problem but is
> there a better way to handle this?
> (E.g reading only a part of the entries at a time)
>
> Increasing the timeout really isn't a viable solution as I can never be sure
> how many dir entries a client has or the performance of its hardware.
Hi Henrik,
I regularly test against large directories of greater than 2000 files without
encountering any such problems. Also, the results you're seeing, obtaining
only a single character for each file name makes no sense for a timeout issue.
Are you absolutely sure you don't have a problem with your wrapper? Are you
using the latest release of Samba?
If you become convinced that this is in fact a Samba problem, please open a
'libsmbclient' bug in bugzilla. Attach a raw packet trace generated with
"tcpdump -s 0 -w truncated-file-names.pcap". I'll take a look.
Cheers,
Derrell
More information about the samba-technical
mailing list