s3/smbd: change locking behavior when "lock spin time = 0".
commit5541251d642da252d8b8129f402921a27276cc5b
authorSteven Danneman <steven.danneman@isilon.com>
Fri, 12 Feb 2010 23:42:50 +0000 (12 15:42 -0800)
committerKarolin Seeger <kseeger@samba.org>
Tue, 16 Feb 2010 09:04:10 +0000 (16 10:04 +0100)
treeff87ff4d763c55e72b1cb24043282888d47bbad5
parent00d2c875b64c31a58694f8331391b9335af0a220
s3/smbd: change locking behavior when "lock spin time = 0".

The "lock spin time" parameter mimics the following Windows
setting which by default is 250ms in Windows and 200ms in Samba.

HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\LanmanServer\Parameters\LockViolationDelay

When a client sends repeated, non-blocking, contending BRL requests
to a Windows server, after the first Windows starts treating these
requests as timed blocking locks with the above timeout.

As an efficiency, I've changed the behavior when this setting is 0,
to skip this logic and treat all requests as non-blocking locks.

This gives the smbd server behavior similar to the 3.0 release with
the do_spin_lock() implementation.

I've also changed the blocking lock parameter in the call from
push_blocking_lock_request() to true as all requests made in this
path are blocking by definition.
(cherry picked from commit cb0ea273696fc9024e6da18eb3e319024f8643f5)

Fix bug #7138 (Backport 'lock spin time" enhancement to 3.5.1).
(cherry picked from commit 3e72ded677389816dd4f502792139cd8b2945f98)
source3/smbd/blocking.c
source3/smbd/reply.c