Fcntl hangs in 2.2.5 on Solaris

David Collier-Brown davecb at canada.sun.com
Wed Aug 14 05:44:00 GMT 2002

jra at dp.samba.org wrote:
> On Mon, Aug 12, 2002 at 03:01:14PM -0400, David Collier-Brown wrote:
> >   Ok, I've been looking at portable locking mechanisms and fcntl.
> >
> >   A Smarter Colleague (Mark) pointed out that there are
> > scalability issues with fcntl locks on both Solaris
> > and Linux, but quite different ones.
> We haven't yet hit any scalability problems with fcntl
> locks on Linux. We use them in Samba a *lot* with the tdb's.
> Sorry Dave, as far as I can see this (at least the Samba fcntl
> issue) is a Solaris only problem :-) :-).

	Yes, it indeed only occurs with Solaris: Samba
	deosn't erally do anything non-scalable, it's
	actually the mapping of application locks to 
	samba to fcntl locks on Solaris that isn't scaling.
> The tdb spinlock code is really unsafe to use in a production
> environment due to the potential to lock up the entire db
> on abend. Now I know you can make no consistency guarentees
> on abend even with fcntl locks, but when a process abends with
> an fcntl lock the lock is at least released to allow others to
> attempt a cleanup.

	Posix locks, with the EOWNERDEAD hook have the same
	cleanup guarantees as fcntl locks.  The real disadvantage
	is that they are not file-related locks, and even
	though they have some advantages, do not protect
	against a Unix process and a client using SMB from
	whacking a file.  Whacking as in "The Sopranos" (;-))

	That's why they're a workaround.
> Please just fix the Solaris fcntl lock problem :-) :-).

	I may need to drag you into the detailed discussion
	to help expose what exactly is needed by Samba,
	so we can see why our algorithm doesn't provide it...

David Collier-Brown,           | Always do right. This will gratify 
Performance & Engineering      | some people and astonish the rest.
Americas Customer Engineering, |                      -- Mark Twain
(905) 415-2849                 | davecb at canada.sun.com

More information about the samba-technical mailing list