summaryrefslogtreecommitdiffstats
path: root/source/locking/brlock.c
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2000-04-27 23:28:56 +0000
committerJeremy Allison <jra@samba.org>2000-04-27 23:28:56 +0000
commit6baa96bb466915cc17e8cbad50254d6bd47b967b (patch)
treecb2ca759fdfb972790e0798e96357333657c2c1c /source/locking/brlock.c
parent2746e5602e493e5b022764b4b839eb4d2f14363b (diff)
downloadsamba-6baa96bb466915cc17e8cbad50254d6bd47b967b.tar.gz
samba-6baa96bb466915cc17e8cbad50254d6bd47b967b.tar.xz
samba-6baa96bb466915cc17e8cbad50254d6bd47b967b.zip
Ok - this is more subtle than it looks :-).
When a file is being closed, once it passes the fnum and tid tests then the locking context should be ignored when removing all locks. This is what is done in the brl close case, but when you have outstanding POSIX locks, then you cannot remove all the brl locks in one go, you have to get the lock list and call do_unlock individually. As this uses global_smbpid as the locking context, you need to make sure that this is set correctly for the specific lock being removed. I now do this by storing the smbpid in each entry in the unlock list returned from the query call. I removed the smbpid from fsp (not needed) and things seem ok (even with the stupid smbpid tricks that smbtorture plays :-). Jeremy.
Diffstat (limited to 'source/locking/brlock.c')
-rw-r--r--source/locking/brlock.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/source/locking/brlock.c b/source/locking/brlock.c
index ed1f73df5ed..410fb3fc0bd 100644
--- a/source/locking/brlock.c
+++ b/source/locking/brlock.c
@@ -367,6 +367,7 @@ BECOMES.....
ZERO_STRUCTP(ul_new);
ul_new->start = lock->start + lock->size;
ul_new->size = ul_curr->start + ul_curr->size - ul_new->start;
+ ul_new->smbpid = ul_curr->smbpid;
/* Add into the dlink list after the ul_curr point - NOT at ulhead. */
DLIST_ADD(ul_curr, ul_new);
@@ -638,6 +639,7 @@ struct unlock_list *brl_getlocklist( TALLOC_CTX *ctx, SMB_DEV_T dev, SMB_INO_T i
ZERO_STRUCTP(ul_new);
ul_new->start = lock->start;
ul_new->size = lock->size;
+ ul_new->smbpid = lock->context.smbpid;
DLIST_ADD(ulist, ul_new);
}