summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2017-07-12 08:47:33 +0200
committerStefan Metzmacher <metze@samba.org>2017-07-12 08:50:24 +0200
commit8d23e3321d7c7013530969d354b8e47f1724ba93 (patch)
tree43d19b190e868cc6845c20e0ea372a2e5917855d
parenta709729657997dcc36329979977e1bdbbc3c98e0 (diff)
downloadsamba-8d23e3321d7c7013530969d354b8e47f1724ba93.tar.gz
Revert "s3: locking: Update oplock optimization for the leases era !"
This reverts commit 2e00feb278e174fd28d003c4d5a576f91c0bd7d0. This should not have been in 4-4-test, see https://bugzilla.samba.org/show_bug.cgi?id=12628#c6 v4-4-test is in the security fixes only mode. This also introduces a regression that's fixed in v4-5 and higer only, see https://bugzilla.samba.org/show_bug.cgi?id=12798 Signed-off-by: Stefan Metzmacher <metze@samba.org>
-rw-r--r--source3/locking/locking.c22
1 files changed, 9 insertions, 13 deletions
diff --git a/source3/locking/locking.c b/source3/locking/locking.c
index e6d3918db79..5a9746094ba 100644
--- a/source3/locking/locking.c
+++ b/source3/locking/locking.c
@@ -118,21 +118,17 @@ bool strict_lock_default(files_struct *fsp, struct lock_struct *plock)
}
if (strict_locking == Auto) {
- uint32_t lease_type = fsp_lease_type(fsp);
-
- if ((lease_type & SMB2_LEASE_READ) &&
- (plock->lock_type == READ_LOCK))
- {
- DBG_DEBUG("optimisation - read lease on file %s\n",
- fsp_str_dbg(fsp));
+ if (EXCLUSIVE_OPLOCK_TYPE(fsp->oplock_type) &&
+ (plock->lock_type == READ_LOCK ||
+ plock->lock_type == WRITE_LOCK)) {
+ DEBUG(10, ("is_locked: optimisation - exclusive oplock "
+ "on file %s\n", fsp_str_dbg(fsp)));
return true;
}
-
- if ((lease_type & SMB2_LEASE_WRITE) &&
- (plock->lock_type == WRITE_LOCK))
- {
- DBG_DEBUG("optimisation - write lease on file %s\n",
- fsp_str_dbg(fsp));
+ if ((fsp->oplock_type == LEVEL_II_OPLOCK) &&
+ (plock->lock_type == READ_LOCK)) {
+ DEBUG(10, ("is_locked: optimisation - level II oplock "
+ "on file %s\n", fsp_str_dbg(fsp)));
return true;
}
}