r17105: Fix the race Volker found - we had a non-locked
authorJeremy Allison <jra@samba.org>
Tue, 18 Jul 2006 01:05:51 +0000 (01:05 +0000)
committerGerald (Jerry) Carter <jerry@samba.org>
Wed, 10 Oct 2007 16:38:12 +0000 (11:38 -0500)
commitb737f26764cce935d9482335ece11c71a96720f4
treee2d21c8b53815c90092437b2c4dc14bf5b34e560
parent94ad8543bd27c6cbdcdaf4acf84d91438dbef28b
r17105: Fix the race Volker found - we had a non-locked
region between detecting a pending lock was needed
and when we added the blocking lock record. Make
sure that we hold the lock over all this period.
Removed the old code for doing blocking locks on
SMB requests that never block (the old SMBlock
and friends).
Discovered something interesting about the strange
NT_STATUS_FILE_LOCK_CONFLICT return. If we asked
for a lock with zero timeout, and we got an error
of NT_STATUS_FILE_LOCK_CONFLICT, treat it as though
it was a blocking lock with a timeout of 150 - 300ms.
This only happens when timeout is sent as zero and
can be seen quite clearly in ethereal. This is the
real replacement for old do_lock_spin() code.
Re-worked the blocking lock select timeout to correctly
use milliseconds instead of the old second level
resolution (far too coarse for this work).
Jeremy.
(This used to be commit b81d6d1ae95a3d3e449dde629884b565eac289d9)
source3/locking/brlock.c
source3/locking/locking.c
source3/smbd/blocking.c
source3/smbd/process.c
source3/smbd/reply.c
source3/smbd/trans2.c