]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
smbd: Avoid exit_server() in setup_kernel_oplock_poll_open()
authorVolker Lendecke <vl@samba.org>
Tue, 30 Jul 2019 11:41:17 +0000 (13:41 +0200)
committerJeremy Allison <jra@samba.org>
Wed, 7 Aug 2019 23:45:49 +0000 (23:45 +0000)
Failure to postpone a request is not really fatal: We just don't retry
as wanted but return an error to the client that might have resolved
itself after a few seconds. From my point of view such a spurious and
rare error, which is highly unlikely anyway does not justify to kill
that client's connection.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
source3/smbd/open.c

index 0bee47fbf4f58aea11595766b0450d5ba4e4c476..9436df4444fa15cdb25966d5eafc3fd032406df8 100644 (file)
@@ -2523,23 +2523,28 @@ static void setup_kernel_oplock_poll_open(struct smb_request *req,
 
        open_rec = talloc_zero(NULL, struct deferred_open_record);
        if (open_rec == NULL) {
-               exit_server("talloc failed");
+               DBG_WARNING("talloc failed\n");
+               return;
        }
        open_rec->xconn = req->xconn;
        open_rec->mid = req->mid;
 
-       ok = push_deferred_open_message_smb(req, timeout, id, open_rec);
-       if (!ok) {
-               exit_server("push_deferred_open_message_smb failed");
-       }
-
        open_rec->te = tevent_add_timer(req->sconn->ev_ctx,
                                        open_rec,
                                        timeval_current_ofs(1, 0),
                                        kernel_oplock_poll_open_timer,
                                        open_rec);
        if (open_rec->te == NULL) {
-               exit_server("tevent_add_timer failed");
+               DBG_WARNING("tevent_add_timer failed\n");
+               TALLOC_FREE(open_rec);
+               return;
+       }
+
+       ok = push_deferred_open_message_smb(req, timeout, id, open_rec);
+       if (!ok) {
+               DBG_WARNING("push_deferred_open_message_smb failed\n");
+               TALLOC_FREE(open_rec);
+               return;
        }
 
        DBG_DEBUG("poll request time [%s] mid [%" PRIu64 "] file_id [%s]\n",