summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVolker Lendecke <vl@samba.org>2019-08-10 21:15:22 +0200
committerJeremy Allison <jra@samba.org>2019-08-19 23:14:39 +0000
commita4192bc70d7717a5072ccdd8e53b7dda7e6d9c98 (patch)
tree1f0972a33612464de4220511bc2e33ae1289bf93
parent10679b67d1372bde37a1cdd639bebcc5f79a9c1b (diff)
downloadsamba-a4192bc70d7717a5072ccdd8e53b7dda7e6d9c98.tar.gz
smbd: Make delay_for_oplock() return NTSTATUS
A further commit will merge grant_fsp_oplock_type (returning NTSTATUS) into delay_for_oplock(). Make that commit smaller. Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
-rw-r--r--source3/smbd/open.c28
1 files changed, 15 insertions, 13 deletions
diff --git a/source3/smbd/open.c b/source3/smbd/open.c
index 901d0db6f51..a38082790b6 100644
--- a/source3/smbd/open.c
+++ b/source3/smbd/open.c
@@ -1856,13 +1856,13 @@ static bool is_same_lease(const files_struct *fsp,
&e->lease_key);
}
-static bool delay_for_oplock(files_struct *fsp,
- int oplock_request,
- const struct smb2_lease *lease,
- struct share_mode_lock *lck,
- bool have_sharing_violation,
- uint32_t create_disposition,
- bool first_open_attempt)
+static NTSTATUS delay_for_oplock(files_struct *fsp,
+ int oplock_request,
+ const struct smb2_lease *lease,
+ struct share_mode_lock *lck,
+ bool have_sharing_violation,
+ uint32_t create_disposition,
+ bool first_open_attempt)
{
struct share_mode_data *d = lck->data;
uint32_t i;
@@ -1872,7 +1872,7 @@ static bool delay_for_oplock(files_struct *fsp,
SMB2_LEASE_HANDLE : SMB2_LEASE_WRITE;
if (is_stat_open(fsp->access_mask)) {
- return false;
+ return NT_STATUS_OK;
}
switch (create_disposition) {
@@ -1966,7 +1966,10 @@ static bool delay_for_oplock(files_struct *fsp,
}
}
- return delay;
+ if (delay) {
+ return NT_STATUS_RETRY;
+ }
+ return NT_STATUS_OK;
}
static bool file_has_brlocks(files_struct *fsp)
@@ -2342,7 +2345,6 @@ static NTSTATUS handle_share_mode_lease(
bool first_open_attempt)
{
bool sharing_violation = false;
- bool delay = false;
NTSTATUS status;
status = open_mode_check(
@@ -2371,7 +2373,7 @@ static NTSTATUS handle_share_mode_lease(
return NT_STATUS_OK;
}
- delay = delay_for_oplock(
+ status = delay_for_oplock(
fsp,
oplock_request,
lease,
@@ -2379,8 +2381,8 @@ static NTSTATUS handle_share_mode_lease(
sharing_violation,
create_disposition,
first_open_attempt);
- if (delay) {
- return NT_STATUS_RETRY;
+ if (!NT_STATUS_IS_OK(status)) {
+ return status;
}
if (sharing_violation) {