[SCM] Samba Shared Repository - branch v3-5-stable updated

Karolin Seeger kseeger at samba.org
Tue Feb 16 02:04:23 MST 2010


The branch, v3-5-stable has been updated
       via  5541251... s3/smbd: change locking behavior when "lock spin time = 0".
       via  00d2c87... Fix error in docs. Should be milliseconds, not microseconds. (cherry picked from commit c7f16abc47a2d291d3da95b4c8e654010e36bc0f) (cherry picked from commit 53531cb983739391fc70b1490f29d294785fee68)
      from  c4fbf77... s3: by default don't use pthread pool support (cherry picked from commit 118725c892e445fcc1dc5947cb919cf99c49373f)

http://gitweb.samba.org/?p=samba.git;a=shortlog;h=v3-5-stable


- Log -----------------------------------------------------------------
commit 5541251d642da252d8b8129f402921a27276cc5b
Author: Steven Danneman <steven.danneman at isilon.com>
Date:   Fri Feb 12 15:42:50 2010 -0800

    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)

commit 00d2c875b64c31a58694f8331391b9335af0a220
Author: Jeremy Allison <jra at samba.org>
Date:   Fri Feb 12 21:29:58 2010 -0800

    Fix error in docs. Should be milliseconds, not microseconds.
    (cherry picked from commit c7f16abc47a2d291d3da95b4c8e654010e36bc0f)
    (cherry picked from commit 53531cb983739391fc70b1490f29d294785fee68)

-----------------------------------------------------------------------

Summary of changes:
 docs-xml/smbdotconf/locking/lockspintime.xml |    2 +-
 source3/smbd/blocking.c                      |    2 +-
 source3/smbd/reply.c                         |   21 +++++++++++++++------
 3 files changed, 17 insertions(+), 8 deletions(-)


Changeset truncated at 500 lines:

diff --git a/docs-xml/smbdotconf/locking/lockspintime.xml b/docs-xml/smbdotconf/locking/lockspintime.xml
index da84d93..8e40877 100644
--- a/docs-xml/smbdotconf/locking/lockspintime.xml
+++ b/docs-xml/smbdotconf/locking/lockspintime.xml
@@ -3,7 +3,7 @@
                  context="G"
                  xmlns:samba="http://www.samba.org/samba/DTD/samba-doc">
 <description>
-	<para>The time in microseconds that smbd should 
+	<para>The time in milliseconds that smbd should 
 	keep waiting to see if a failed lock request can
 	be granted. This parameter has changed in default
 	value from Samba 3.0.23 from 10 to 200. The associated
diff --git a/source3/smbd/blocking.c b/source3/smbd/blocking.c
index deb7f8f..e33c0b6 100644
--- a/source3/smbd/blocking.c
+++ b/source3/smbd/blocking.c
@@ -185,7 +185,7 @@ bool push_blocking_lock_request( struct byte_range_lock *br_lck,
 			count,
 			lock_type == READ_LOCK ? PENDING_READ_LOCK : PENDING_WRITE_LOCK,
 			blr->lock_flav,
-			lock_timeout ? True : False, /* blocking_lock. */
+			True,
 			NULL,
 			blr);
 
diff --git a/source3/smbd/reply.c b/source3/smbd/reply.c
index b6316aa..b1a4e31 100644
--- a/source3/smbd/reply.c
+++ b/source3/smbd/reply.c
@@ -7120,13 +7120,22 @@ NTSTATUS smbd_do_locking(struct smb_request *req,
 				defer_lock = true;
 			}
 
-			/* This heuristic seems to match W2K3 very well. If a
-			   lock sent with timeout of zero would fail with NT_STATUS_FILE_LOCK_CONFLICT
-			   it pretends we asked for a timeout of between 150 - 300 milliseconds as
-			   far as I can tell. Replacement for do_lock_spin(). JRA. */
+			/* If a lock sent with timeout of zero would fail, and
+			 * this lock has been requested multiple times,
+			 * according to brl_lock_failed() we convert this
+			 * request to a blocking lock with a timeout of between
+			 * 150 - 300 milliseconds.
+			 *
+			 * If lp_lock_spin_time() has been set to 0, we skip
+			 * this blocking retry and fail immediately.
+			 *
+			 * Replacement for do_lock_spin(). JRA. */
 
-			if (br_lck && lp_blocking_locks(SNUM(conn)) && !blocking_lock &&
-					NT_STATUS_EQUAL((status), NT_STATUS_FILE_LOCK_CONFLICT)) {
+			if (br_lck && lp_blocking_locks(SNUM(conn)) &&
+			    lp_lock_spin_time() && !blocking_lock &&
+			    NT_STATUS_EQUAL((status),
+				NT_STATUS_FILE_LOCK_CONFLICT))
+			{
 				defer_lock = true;
 				timeout = lp_lock_spin_time();
 			}


-- 
Samba Shared Repository


More information about the samba-cvs mailing list