diff options
-rw-r--r-- | source3/smbd/open.c | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/source3/smbd/open.c b/source3/smbd/open.c index 89ff9ae809..ccd12c6946 100644 --- a/source3/smbd/open.c +++ b/source3/smbd/open.c @@ -1650,6 +1650,15 @@ NTSTATUS open_file_ntcreate(connection_struct *conn, return NT_STATUS_SHARING_VIOLATION; } + /* First pass - send break only on batch oplocks. */ + if (delay_for_oplocks(lck, fsp, 1, oplock_request)) { + schedule_defer_open(lck, request_time); + TALLOC_FREE(lck); + fd_close(conn, fsp); + file_free(fsp); + return NT_STATUS_SHARING_VIOLATION; + } + status = open_mode_check(conn, fname, lck, access_mask, share_access, create_options, &file_existed); @@ -1677,6 +1686,14 @@ NTSTATUS open_file_ntcreate(connection_struct *conn, return status; } + if (delay_for_oplocks(lck, fsp, 2, oplock_request)) { + schedule_defer_open(lck, request_time); + TALLOC_FREE(lck); + fd_close(conn, fsp); + file_free(fsp); + return NT_STATUS_SHARING_VIOLATION; + } + /* * We exit this block with the share entry *locked*..... */ |