From 0c2e763aaa05f63bb8563e62f9731e35afa9ed86 Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Fri, 20 Jun 2014 14:15:19 +0000 Subject: [PATCH] smbd: First watch, then defer We exit if any of these if-statement fails, so a simple swap should not make a difference. Signed-off-by: Volker Lendecke Reviewed-by: Jeremy Allison --- source3/smbd/open.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/source3/smbd/open.c b/source3/smbd/open.c index c0f4dea3ac9..9cbc046760f 100644 --- a/source3/smbd/open.c +++ b/source3/smbd/open.c @@ -1580,11 +1580,6 @@ static void defer_open(struct share_mode_lock *lck, *open_rec = *state; - if (!push_deferred_open_message_smb(req, request_time, timeout, - state->id, open_rec)) { - TALLOC_FREE(lck); - exit_server("push_deferred_open_message_smb failed"); - } if (lck) { struct defer_open_state *watch_state; struct tevent_req *watch_req; @@ -1614,6 +1609,12 @@ static void defer_open(struct share_mode_lock *lck, timeval_sum(&request_time, &timeout)); SMB_ASSERT(ret); } + + if (!push_deferred_open_message_smb(req, request_time, timeout, + state->id, open_rec)) { + TALLOC_FREE(lck); + exit_server("push_deferred_open_message_smb failed"); + } } static void defer_open_done(struct tevent_req *req)