Locking Worries

Romeril, Alan a.romeril at ic.ac.uk
Sun Jul 22 14:12:23 GMT 2001

Hello All,
	I`m wondering if there`s something wrong with the locking mechanism
that shows itself when a Win2k client logs on and pulls a profile from a
Samba server.  Having tried to plough through it, and ended up with a big
headache, it`s time to bounce this off the Technical list.  
	Here`s the problem....
A file, for example, ntuser.dat is opened by the client during a logon with
an NTCreateX Request and an oplock is granted on the file in the NTCreateX
Later on in the logon the file is opened again by the client again with an
NTCreateX Request which generates the following series from the Samba
		Packet						Time From
NTCreateX Request
	server -> Win2K client SMBlockingX Response
	Win2K client -> server SMBlockingX Request
	server -> Win2K client SMBlockingX Response
	server -> Win2K client SMBntcreate Response
150ms	!!!

Compare that with Win2K logging on to NT4.
		Packet						Time From
NTCreateX Request
	NT server -> Win2K client SMBlockingX Response		0.8 ms
	Win2K client -> NT server SMBlockingX Request			2.7
	NT server -> Win2K client SMBntcreate Response		0.5 ms

Something's really going wrong here :/ 
Reading the CIFS spec it says "If the client sends an SMB_LOCKING_ANDX SMB
with the LOCKING_ANDX_OPLOCK_RELEASE flag set and NumberOFLocks is zero, the
server MUST NOT send a response.  Since a close being sent to the server and
break oplock notification from the server could cross on the wire", is Samba
waiting on a reply to the second SMBlockingX Response that isn`t going to
come and so holding up everything for no reason?  Those conditions seem
true, but the server response is still being sent.  Can someone with much
more locking experience take a look at this, because even on a small default
profile load there can be 20 of these sets of transactions (that`s 3 seconds
wasted), and on much bigger profiles the logon can take ages.  The files
that seem to be opened, locked, unlocked and closed in quick succession
include the .lnks like those in the recent and favorite folders and as there
can be hundreds of these you can see where the time goes...

Best Regards,

More information about the samba-technical mailing list