summaryrefslogtreecommitdiff
path: root/source3/locking
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2001-07-02 02:42:41 +0000
committerJeremy Allison <jra@samba.org>2001-07-02 02:42:41 +0000
commit5b69009b25886bfa8b07e3ac885064ffa730f9bf (patch)
tree4c86f9c30c3d29d948f11c7503db5f70d9934e52 /source3/locking
parent82b76931cb62ea952fb0a4091880a8e0188530c8 (diff)
downloadsamba-5b69009b25886bfa8b07e3ac885064ffa730f9bf.tar.gz
samba-5b69009b25886bfa8b07e3ac885064ffa730f9bf.tar.bz2
samba-5b69009b25886bfa8b07e3ac885064ffa730f9bf.zip
Fixed the nastiest locking bug to track down.... smb_pids are sent in the
lockingX calls - use that instead of smb_pid in the packet. Jeremy. (This used to be commit a3925cb9c6303ce24e5fecad6c8f3a0ba78b9ee0)
Diffstat (limited to 'source3/locking')
-rw-r--r--source3/locking/locking.c12
-rw-r--r--source3/locking/posix.c1
2 files changed, 6 insertions, 7 deletions
diff --git a/source3/locking/locking.c b/source3/locking/locking.c
index a75388081e..067b1dc0dd 100644
--- a/source3/locking/locking.c
+++ b/source3/locking/locking.c
@@ -37,7 +37,7 @@
#include "includes.h"
extern int DEBUGLEVEL;
-int global_smbpid;
+uint16 global_smbpid;
/* the locking database handle */
static TDB_CONTEXT *tdb;
@@ -99,7 +99,7 @@ BOOL is_locked(files_struct *fsp,connection_struct *conn,
Utility function called by locking requests.
****************************************************************************/
-BOOL do_lock(files_struct *fsp,connection_struct *conn,
+BOOL do_lock(files_struct *fsp,connection_struct *conn, uint16 lock_pid,
SMB_BIG_UINT count,SMB_BIG_UINT offset,enum brl_type lock_type,
int *eclass,uint32 *ecode)
{
@@ -119,7 +119,7 @@ BOOL do_lock(files_struct *fsp,connection_struct *conn,
if (OPEN_FSP(fsp) && fsp->can_lock && (fsp->conn == conn)) {
ok = brl_lock(fsp->dev, fsp->inode, fsp->fnum,
- global_smbpid, sys_getpid(), conn->cnum,
+ lock_pid, sys_getpid(), conn->cnum,
offset, count,
lock_type);
@@ -139,7 +139,7 @@ BOOL do_lock(files_struct *fsp,connection_struct *conn,
* lock entry.
*/
(void)brl_unlock(fsp->dev, fsp->inode, fsp->fnum,
- global_smbpid, sys_getpid(), conn->cnum,
+ lock_pid, sys_getpid(), conn->cnum,
offset, count);
}
}
@@ -157,7 +157,7 @@ BOOL do_lock(files_struct *fsp,connection_struct *conn,
Utility function called by unlocking requests.
****************************************************************************/
-BOOL do_unlock(files_struct *fsp,connection_struct *conn,
+BOOL do_unlock(files_struct *fsp,connection_struct *conn, uint16 lock_pid,
SMB_BIG_UINT count,SMB_BIG_UINT offset,
int *eclass,uint32 *ecode)
{
@@ -182,7 +182,7 @@ BOOL do_unlock(files_struct *fsp,connection_struct *conn,
*/
ok = brl_unlock(fsp->dev, fsp->inode, fsp->fnum,
- global_smbpid, sys_getpid(), conn->cnum, offset, count);
+ lock_pid, sys_getpid(), conn->cnum, offset, count);
if (!ok) {
DEBUG(10,("do_unlock: returning ERRlock.\n" ));
diff --git a/source3/locking/posix.c b/source3/locking/posix.c
index 9cfe25ed9d..2a8a7aacd7 100644
--- a/source3/locking/posix.c
+++ b/source3/locking/posix.c
@@ -25,7 +25,6 @@
#include "includes.h"
extern int DEBUGLEVEL;
-extern int global_smbpid;
/*
* The POSIX locking database handle.