[Samba] CreateHardLink problem

David Overton david at overtons.id.au
Wed Mar 4 02:36:41 GMT 2009

Hi Volker,

2009/3/4 Volker Lendecke <Volker.Lendecke at sernet.de>:
> On Tue, Mar 03, 2009 at 11:21:46PM +1100, David Overton wrote:
>> 2009/3/3 Volker Lendecke <Volker.Lendecke at sernet.de>:
>> > On Tue, Mar 03, 2009 at 06:13:42PM +1100, David Overton wrote:
>> >> I'm developing a Windows backup application that needs to be able to
>> >> create possibly hundreds of thousands of hard links on an SMB share.
>> >> I'm running into a strange problem when that share happens to be on a
>> >> Samba server.  When the application tries to create the 10000th hard
>> >> link, the win32 CreateHardLink() function returns error code 5 "Access
>> >> is denied".  The Samba log shows:
>> >>
>> >> [2009/03/03 01:29:08,  0] smbd/files.c:file_new(79)
>> >>   ERROR! Out of file structures
>> >
>> > Can you send a sniff of what your application is doing? We
>> > *might* have a fd leak somewhere. But apart from that -- you
>> > do close your files after you've used them?
>> Attached is gzipped output of running tshark as suggested at
>> http://wiki.samba.org/index.php/Capture_Packets.  If you need more
>> information let me know.
> Thanks, that is what I need. It might take a few days, but
> those 20MB in my inbox will definitely remind me of a TODO
> for me :-)

I've had a look at the sniff myself and it pointed me to a bug in my
code.  It was using FindFirstFile to obtain some metadata about each
file before calling CreateHardLink, but it wasn't calling FindClose.
I'm guessing that this was causing Samba to leave file descriptors

Sorry for wasting your time on this.  Thanks for your help.


More information about the samba mailing list