1
0
mirror of https://github.com/samba-team/samba.git synced 2025-02-28 01:58:17 +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
This commit is contained in:
Stefan Metzmacher 2022-08-15 09:56:15 +02:00 committed by Jeremy Allison
parent 60ae7a5a2e
commit d4f18f99d3

View File

@ -2536,7 +2536,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;
@ -2555,7 +2555,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 */
@ -2597,6 +2597,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 &&