libsmbclient multiple processes ... very confused.

Akshay V Rao avrao at us.ibm.com
Tue Jun 17 18:38:54 GMT 2003


Description of what is to happen:
My program forks into N child forked processes.  Each child forked process 
calls smbc_init and smbc_opendir and then proceeds to a while loop in 
which it issues the following calls in order: smbc_readdir, smbc_open, 
smbc_read, smbc_close.  After the while loop, it then issues a call to 
smbc_closedir.  The N processes are all executing simultaneously, and 
reading data from a common share.  It is at this point where the locking 
occurs. If I only set it to fork one process (N = 1), there is no locking 
problem.  Otherwise, the locking problem exists.  Below is a tcpdump of 2 
processes attacking a share.



10.10.10.108 is where the program is being run.
10.10.10.107 is the share that is being read from.
_________________________________
Akshay Rao
IBM zSeries Linux Scalability Center Coop






Richard Sharpe <rsharpe at richardsharpe.com>
06/16/2003 06:57 PM

 
        To:     Akshay V Rao/Poughkeepsie/IBM at IBMUS
        cc:     <samba-technical at lists.samba.org>
        Subject:        Re: libsmbclient multiple processes ... very confused.



On Mon, 16 Jun 2003, Akshay V Rao wrote:

> I first had a deadlock when reading files using multiple forked process 
> from a single smb share. I thought it was due to the fact that I called 
> smbc_init before i forked the processes, and used shared memory to 
> communicate common data.  I then proceeded to rectify this by issuing 
the 
> smbc_init call after forking - in the individual foked processes, so 
they 
> are in different address spaces.  I still however, run into a deadlock 
> problem. When running the program set to 1 process, it works fine.  When 

> running the program set to 2 processes, it freezes.  I was wondering if 
> anyone could help me.  I am using Samba 2.2.7a.  Does Samba 3.0 take 
care 
> of this problem?

Hi,

I think that we are going to need to see what is happening at the protocol 

level to figure this out. 

Can you grab a tcpdump capture or something like that of the packet 
activity that occurs, and send it to us along with what an outline of what 

you think each process should be doing.

In answer to your question, there should be no significant differences 
between the libsmbclient code in 2.2.7a, 2.2.8a and 3.0.0, especially with 

respect to what you are doing.

Regards
-----
Richard Sharpe, rsharpe[at]ns.aus.com, rsharpe[at]samba.org, 
sharpe[at]ethereal.com, http://www.richardsharpe.com



-------------- next part --------------
A non-text attachment was scrubbed...
Name: tcpdump.log
Type: application/octet-stream
Size: 11526 bytes
Desc: not available
Url : http://lists.samba.org/archive/samba-technical/attachments/20030617/4e614f41/tcpdump.obj


More information about the samba-technical mailing list