diff options
author | Jeremy Allison <jra@samba.org> | 2002-03-13 20:28:19 +0000 |
---|---|---|
committer | Jeremy Allison <jra@samba.org> | 2002-03-13 20:28:19 +0000 |
commit | 5e3b923124e82b1d19875746676df13cfdb0f918 (patch) | |
tree | 0ed715a7a0e2411dfb5b5a732278fc5eb9be3832 /source3/param | |
parent | 2001b83faa9f0438adda40ffe12fea4a3dc6a733 (diff) | |
download | samba-5e3b923124e82b1d19875746676df13cfdb0f918.tar.gz samba-5e3b923124e82b1d19875746676df13cfdb0f918.tar.bz2 samba-5e3b923124e82b1d19875746676df13cfdb0f918.zip |
include/smb_macros.h: Don't round up an allocation if the size is zero.
"One of these locks is not like the others... One of these locks is not
quite the same" :-). When is a zero timeout lock not zero ? When it's
being processed by Windows 2000 of course.. This code change, ugly though
it is - completely fixes the foxpro/access multi-user file system database
problems that people have been having. I used a *wonderful* test program
donated by "Gerald Drouillard" <gerald@drouillard.ca> which allowed me
to completely reproduce this problem, and to finally determine the correct
fix. This also explains why Windows 2000 is *so slow* when responding to
the smbtorture lock tests. I *love* it when all these things come together
and finally make sense :-).
Jeremy.
(This used to be commit 8aa9860ea2ea7f5aed4b6aa12794fffdfa81b0d0)
Diffstat (limited to 'source3/param')
-rw-r--r-- | source3/param/loadparm.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index ec7d768023..12dedc7a01 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -198,6 +198,8 @@ typedef struct int min_passwd_length; int oplock_break_wait_time; int winbind_cache_time; + int iLockSpinCount; + int iLockSpinTime; #ifdef WITH_LDAP_SAM char *szLdapMachineSuffix; char *szLdapUserSuffix; @@ -965,6 +967,8 @@ static struct parm_struct parm_table[] = { {"fake oplocks", P_BOOL, P_LOCAL, &sDefault.bFakeOplocks, NULL, NULL, FLAG_SHARE}, {"kernel oplocks", P_BOOL, P_GLOBAL, &Globals.bKernelOplocks, NULL, NULL, FLAG_GLOBAL}, {"locking", P_BOOL, P_LOCAL, &sDefault.bLocking, NULL, NULL, FLAG_SHARE | FLAG_GLOBAL}, + {"lock spin count", P_INTEGER, P_GLOBAL, &Globals.iLockSpinCount, NULL, NULL, FLAG_GLOBAL}, + {"lock spin time", P_INTEGER, P_GLOBAL, &Globals.iLockSpinTime, NULL, NULL, FLAG_GLOBAL}, {"oplocks", P_BOOL, P_LOCAL, &sDefault.bOpLocks, NULL, NULL, FLAG_SHARE | FLAG_GLOBAL}, {"level2 oplocks", P_BOOL, P_LOCAL, &sDefault.bLevel2OpLocks, NULL, NULL, FLAG_SHARE | FLAG_GLOBAL}, @@ -1319,6 +1323,8 @@ static void init_globals(void) Globals.min_passwd_length = MINPASSWDLENGTH; /* By Default, 5. */ Globals.oplock_break_wait_time = 0; /* By Default, 0 msecs. */ Globals.enhanced_browsing = True; + Globals.iLockSpinCount = 3; /* Try 2 times. */ + Globals.iLockSpinTime = 10; /* usec. */ #ifdef MMAP_BLACKLIST Globals.bUseMmap = False; #else @@ -1659,6 +1665,8 @@ FN_GLOBAL_INTEGER(lp_stat_cache_size, &Globals.stat_cache_size) FN_GLOBAL_INTEGER(lp_map_to_guest, &Globals.map_to_guest) FN_GLOBAL_INTEGER(lp_min_passwd_length, &Globals.min_passwd_length) FN_GLOBAL_INTEGER(lp_oplock_break_wait_time, &Globals.oplock_break_wait_time) +FN_GLOBAL_INTEGER(lp_lock_spin_count, &Globals.iLockSpinCount) +FN_GLOBAL_INTEGER(lp_lock_sleep_time, &Globals.iLockSpinTime) FN_LOCAL_STRING(lp_preexec, szPreExec) FN_LOCAL_STRING(lp_postexec, szPostExec) FN_LOCAL_STRING(lp_rootpreexec, szRootPreExec) |