1
0
mirror of https://github.com/samba-team/samba.git synced 2025-03-22 02:50:28 +03:00

s3:smbd: let delay_for_oplock_fn() only call leases_db_get() once

get_lease_type() will just call leases_db_get() again for leases,
so only call it for oplocks.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=15125

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>

Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Fri Aug 19 19:39:18 UTC 2022 on sn-devel-184

(cherry picked from commit d4f18f99d3a40a8df00beb006e2731959aa6fad9)
This commit is contained in:
Stefan Metzmacher 2022-08-15 09:56:15 +02:00 committed by Jule Anger
parent cb63afbda1
commit 0b15ebced7

View File

@ -2529,7 +2529,7 @@ static bool delay_for_oplock_fn(
struct files_struct *fsp = state->fsp;
const struct smb2_lease *lease = state->lease;
bool e_is_lease = (e->op_type == LEASE_OPLOCK);
uint32_t e_lease_type = get_lease_type(e, fsp->file_id);
uint32_t e_lease_type = SMB2_LEASE_NONE;
uint32_t break_to;
bool lease_is_breaking = false;
@ -2548,7 +2548,7 @@ static bool delay_for_oplock_fn(
&e->client_guid,
&e->lease_key,
&fsp->file_id,
NULL, /* current_state */
&e_lease_type, /* current_state */
&lease_is_breaking,
NULL, /* breaking_to_requested */
NULL, /* breaking_to_required */
@ -2590,6 +2590,8 @@ static bool delay_for_oplock_fn(
nt_errstr(status));
smb_panic("leases_db_get() failed");
}
} else {
e_lease_type = get_lease_type(e, fsp->file_id);
}
if (!state->got_handle_lease &&