diff options
Diffstat (limited to 'source3/smbd/open.c')
-rw-r--r-- | source3/smbd/open.c | 27 |
1 files changed, 18 insertions, 9 deletions
diff --git a/source3/smbd/open.c b/source3/smbd/open.c index e0c24dab8d..f49aca8429 100644 --- a/source3/smbd/open.c +++ b/source3/smbd/open.c @@ -1085,7 +1085,7 @@ static void defer_open(struct share_mode_lock *lck, (unsigned long long)req->mid)); if (!push_deferred_open_message_smb(req, request_time, timeout, - (char *)state, sizeof(*state))) { + state->id, (char *)state, sizeof(*state))) { exit_server("push_deferred_open_message_smb failed"); } add_deferred_open(lck, req->mid, request_time, state->id); @@ -1449,6 +1449,22 @@ static NTSTATUS calculate_access_mask(connection_struct *conn, } /**************************************************************************** + Remove the deferred open entry under lock. +****************************************************************************/ + +void remove_deferred_open_entry(struct file_id id, uint64_t mid) +{ + struct share_mode_lock *lck = get_share_mode_lock(talloc_tos(), id, + NULL, NULL, NULL); + if (lck == NULL) { + DEBUG(0, ("could not get share mode lock\n")); + } else { + del_deferred_open_entry(lck, mid); + TALLOC_FREE(lck); + } +} + +/**************************************************************************** Open a file with a share mode. Passed in an already created files_struct *. ****************************************************************************/ @@ -1556,14 +1572,7 @@ static NTSTATUS open_file_ntcreate(connection_struct *conn, see if this has timed out. */ /* Remove the deferred open entry under lock. */ - lck = get_share_mode_lock(talloc_tos(), state->id, - NULL, NULL, NULL); - if (lck == NULL) { - DEBUG(0, ("could not get share mode lock\n")); - } else { - del_deferred_open_entry(lck, req->mid); - TALLOC_FREE(lck); - } + remove_deferred_open_entry(state->id, req->mid); /* Ensure we don't reprocess this message. */ remove_deferred_open_message_smb(req->mid); |