[Samba] smbd reads entire directory when creating files?

Matt Mitchell mmitchell at virtualproperties.com
Tue Dec 7 21:59:54 GMT 2004

Jeremy Allison wrote:
> On Tue, Dec 07, 2004 at 02:08:56PM -0600, Matt Mitchell wrote:
>>A strace on the smbd process receiving the files from the windows box 
>>(it is mapped as a share on the 2k3 server) reveals that smbd is looking 
>>up the entire directory (with getdents64) every time it writes a file. 
>>Several times, in fact.  So as the number of files grows, it churns more 
>>and more.  I'm sure most of it is in cache but the data still has to be 
>>moved around in memory.
>>I know this is not necessary for writing/copying files with unix 
>>semantics, but I wonder if the case-fiddling or any other Windows 
>>imitative behavior is making this getdents64 orgy necessary.  Is there 
>>any way to disable it?
> Not currently. This is something I'm working on - would you be
> willing to test some prototype code once I'm done ?

I'd love to.

This file count also exposes some brokenness in the 'tar' functionality 
of smbclient, perhaps in smbclient itself (my next workaround attempt). 
  I'll try to gather more info on that for whoever might be interested, 
or patch it myself if possible.


More information about the samba mailing list