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 | 8aa9860ea2ea7f5aed4b6aa12794fffdfa81b0d0 (patch) | |
tree | c05cc6fc22cbc76084444e96206add565767f70d /source/smbd/blocking.c | |
parent | 93389647203395da0e894c2e57348081e755884a (diff) | |
download | samba-8aa9860ea2ea7f5aed4b6aa12794fffdfa81b0d0.tar.gz samba-8aa9860ea2ea7f5aed4b6aa12794fffdfa81b0d0.tar.xz samba-8aa9860ea2ea7f5aed4b6aa12794fffdfa81b0d0.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.
Diffstat (limited to 'source/smbd/blocking.c')
-rw-r--r-- | source/smbd/blocking.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/source/smbd/blocking.c b/source/smbd/blocking.c index bc8c54caf7c..d4a53d9a6d9 100644 --- a/source/smbd/blocking.c +++ b/source/smbd/blocking.c @@ -279,7 +279,7 @@ static BOOL process_lockread(blocking_lock_record *blr) numtoread = MIN(BUFFER_SIZE-outsize,numtoread); data = smb_buf(outbuf) + 3; - status = do_lock( fsp, conn, SVAL(inbuf,smb_pid), (SMB_BIG_UINT)numtoread, + status = do_lock_spin( fsp, conn, SVAL(inbuf,smb_pid), (SMB_BIG_UINT)numtoread, (SMB_BIG_UINT)startpos, READ_LOCK); if (NT_STATUS_V(status)) { if ((errno != EACCES) && (errno != EAGAIN)) { @@ -345,7 +345,7 @@ static BOOL process_lock(blocking_lock_record *blr) offset = IVAL(inbuf,smb_vwv3); errno = 0; - status = do_lock(fsp, conn, SVAL(inbuf,smb_pid), (SMB_BIG_UINT)count, + status = do_lock_spin(fsp, conn, SVAL(inbuf,smb_pid), (SMB_BIG_UINT)count, (SMB_BIG_UINT)offset, WRITE_LOCK); if (NT_STATUS_IS_ERR(status)) { if((errno != EACCES) && (errno != EAGAIN)) { @@ -417,7 +417,7 @@ static BOOL process_lockingX(blocking_lock_record *blr) * request would never have been queued. JRA. */ errno = 0; - status = do_lock(fsp,conn,lock_pid,count,offset, + status = do_lock_spin(fsp,conn,lock_pid,count,offset, ((locktype & 1) ? READ_LOCK : WRITE_LOCK)); if (NT_STATUS_IS_ERR(status)) break; } |