mirror of
https://github.com/samba-team/samba.git
synced 2025-01-06 13:18:07 +03:00
Revert "s3: locking: Update oplock optimization for the leases era !"
This reverts commit 2e00feb278
.
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>
This commit is contained in:
parent
a709729657
commit
8d23e3321d
@ -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;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user