summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2019-08-19 15:21:50 +0200
committerStefan Metzmacher <metze@samba.org>2019-09-09 16:04:30 +0000
commit333026209a8abe5d9d00297ce7f0d6cdf66d6ce0 (patch)
tree15b65c8b24e833910fbaa40a3a0d971635f928f8
parentf479c7bc03a06a409b0037d7957806ba3208b55b (diff)
downloadsamba-333026209a8abe5d9d00297ce7f0d6cdf66d6ce0.tar.gz
s3:blocking: do the timeout calculation before calling dbwrap_watched_watch_send()
This makes the next commits easier to understand. BUG: https://bugzilla.samba.org/show_bug.cgi?id=14113 Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org> (cherry picked from commit 997548a5f1a14d82f1e80cce6d9ee55e85b5107c)
-rw-r--r--source3/smbd/blocking.c32
1 files changed, 16 insertions, 16 deletions
diff --git a/source3/smbd/blocking.c b/source3/smbd/blocking.c
index 98074c0c09a..ac90f8c3ef1 100644
--- a/source3/smbd/blocking.c
+++ b/source3/smbd/blocking.c
@@ -308,14 +308,6 @@ struct tevent_req *smbd_smb1_do_locks_send(
}
state->deny_status = NT_STATUS_FILE_LOCK_CONFLICT;
- subreq = dbwrap_watched_watch_send(
- state, state->ev, lck->data->record, blocking_pid);
- if (tevent_req_nomem(subreq, req)) {
- goto done;
- }
- TALLOC_FREE(lck);
- tevent_req_set_callback(subreq, smbd_smb1_do_locks_retry, req);
-
endtime = state->endtime;
if (blocking_smblctx == UINT64_MAX) {
@@ -330,6 +322,14 @@ struct tevent_req *smbd_smb1_do_locks_send(
endtime = timeval_min(&endtime, &tmp);
}
+ subreq = dbwrap_watched_watch_send(
+ state, state->ev, lck->data->record, blocking_pid);
+ if (tevent_req_nomem(subreq, req)) {
+ goto done;
+ }
+ TALLOC_FREE(lck);
+ tevent_req_set_callback(subreq, smbd_smb1_do_locks_retry, req);
+
ok = tevent_req_set_endtime(subreq, state->ev, endtime);
if (!ok) {
tevent_req_oom(req);
@@ -450,14 +450,6 @@ static void smbd_smb1_do_locks_try(struct tevent_req *req)
}
state->deny_status = NT_STATUS_FILE_LOCK_CONFLICT;
- subreq = dbwrap_watched_watch_send(
- state, state->ev, lck->data->record, blocking_pid);
- if (tevent_req_nomem(subreq, req)) {
- goto done;
- }
- TALLOC_FREE(lck);
- tevent_req_set_callback(subreq, smbd_smb1_do_locks_retry, req);
-
endtime = state->endtime;
if (blocking_smblctx == UINT64_MAX) {
@@ -472,6 +464,14 @@ static void smbd_smb1_do_locks_try(struct tevent_req *req)
endtime = timeval_min(&endtime, &tmp);
}
+ subreq = dbwrap_watched_watch_send(
+ state, state->ev, lck->data->record, blocking_pid);
+ if (tevent_req_nomem(subreq, req)) {
+ goto done;
+ }
+ TALLOC_FREE(lck);
+ tevent_req_set_callback(subreq, smbd_smb1_do_locks_retry, req);
+
ok = tevent_req_set_endtime(subreq, state->ev, endtime);
if (!ok) {
status = NT_STATUS_NO_MEMORY;