smbd: Use leases_db in delay_for_oplock()
authorVolker Lendecke <vl@samba.org>
Thu, 13 Sep 2018 10:48:30 +0000 (12:48 +0200)
committerChristof Schmitt <cs@samba.org>
Sun, 14 Apr 2019 04:01:31 +0000 (04:01 +0000)
Remove a reference to share_mode_data->leases[]

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Christof Schmitt <cs@samba.org>
source3/smbd/open.c

index e480c97..9c10884 100644 (file)
@@ -1869,7 +1869,19 @@ static bool delay_for_oplock(files_struct *fsp,
                bool lease_is_breaking = false;
 
                if (e_is_lease) {
-                       lease_is_breaking = d->leases[e->lease_idx].breaking;
+                       NTSTATUS status;
+
+                       status = leases_db_get(
+                               &e->client_guid,
+                               &e->lease_key,
+                               &fsp->file_id,
+                               NULL, /* current_state */
+                               &lease_is_breaking,
+                               NULL, /* breaking_to_requested */
+                               NULL, /* breaking_to_required */
+                               NULL, /* lease_version */
+                               NULL); /* epoch */
+                       SMB_ASSERT(NT_STATUS_IS_OK(status));
                }
 
                if (have_sharing_violation) {