Alternate approaches to lock/dead-client problem.

David Collier-Brown davecb at Canada.Sun.COM
Tue Jan 26 20:00:51 GMT 1999


Nicolas Williams wrote:
> But the question is: is it correct to assume that an SMB session over
> TCP is abandoned when a new connection with the same parameters is
> opened to the server?

	It is in a sort of insane sense: the CIFS spec claims
	so, but no-one will admit to actually doing such a 
	dumb thing (:-))

	Any multi-user client can make connections to a server
	on behalf of different users.  Right now I have a connection
	and another process on my box has a connection.  I'd be
	seriously annoyed if the server dropped me when the
	script started.

	The sufficient condition is
		user x from client y has locked file z &&
		client z has crashed and resumed &&
		user x from client y wants file z
	I was working to order this so the minimum number
	of checks occur in a known time-critical path.

	By mostly gut feel I proposed this ordering:
		whenever user x from client y wants file z	1
		&& file z is locked				2
		&& user x from client y has locked file z	3
		&& client z has crashed				4
	in the hopes that the check of line 3 could be decomposed
	into 
		&& lock is from the same host 			3a
		&& user x has locked file z			3b
	so I could bail out of the checking at step 3b, 
	before getting into expensive operations in step 4.

--dave
-- 
David Collier-Brown,  | Always do right. This will gratify some people
185 Ellerslie Ave.,   | and astonish the rest.        -- Mark Twain
Willowdale, Ontario   | http://java.science.yorku.ca/~davecb
Work: (905) 477-0437 Home: (416) 223-8968 Email: davecb at canada.sun.com


More information about the samba-technical mailing list