summaryrefslogtreecommitdiff
path: root/source3/locking/brlock.c
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2006-07-12 06:56:43 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 11:19:16 -0500
commit297df32751fbc64a053700241dae2ac9c0fc4968 (patch)
treeff93dc8b04fa29894cedc1f117551056a3df73d4 /source3/locking/brlock.c
parent4ef1f8e4256a3f7739864236626dacc636d313af (diff)
downloadsamba-297df32751fbc64a053700241dae2ac9c0fc4968.tar.gz
samba-297df32751fbc64a053700241dae2ac9c0fc4968.tar.bz2
samba-297df32751fbc64a053700241dae2ac9c0fc4968.zip
r16973: Fix subtle logic error in lock ref counting found by
cifsfs client code. Jeremy. (This used to be commit 53094435d89088124041d57078c21a12e761e2bf)
Diffstat (limited to 'source3/locking/brlock.c')
-rw-r--r--source3/locking/brlock.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/source3/locking/brlock.c b/source3/locking/brlock.c
index 9c8a7a17ee..eb325fe053 100644
--- a/source3/locking/brlock.c
+++ b/source3/locking/brlock.c
@@ -1229,7 +1229,7 @@ void brl_close_fnum(struct byte_range_lock *br_lck)
struct process_id pid = procid_self();
BOOL unlock_individually = False;
- if(lp_posix_locking(fsp->conn->cnum) && !lp_posix_cifsu_locktype()) {
+ if(lp_posix_locking(fsp->conn->cnum)) {
/* Check if there are any Windows locks associated with this dev/ino
pair that are not this fnum. If so we need to call unlock on each
@@ -1280,9 +1280,6 @@ void brl_close_fnum(struct byte_range_lock *br_lck)
/* We can bulk delete - any POSIX locks will be removed when the fd closes. */
- /* Zero any lock reference count on this dev/ino pair. */
- zero_windows_lock_ref_count(fsp);
-
/* Remove any existing locks for this fnum (or any fnum if they're POSIX). */
for (i=0; i < br_lck->num_locks; i++) {
@@ -1336,6 +1333,9 @@ void brl_close_fnum(struct byte_range_lock *br_lck)
dcount++;
}
}
+
+ /* Reduce the lock reference count on this dev/ino pair. */
+ reduce_windows_lock_ref_count(fsp, dcount);
}
/****************************************************************************