summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2007-05-26 01:26:09 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 12:22:49 -0500
commitf3de07503af29e5593255324fb1f901e878dc776 (patch)
tree93045315a8bc07c249b3bc1403d963d601ee761b
parent4c795b293d34db5fa334c7627fa86d0ed197adcb (diff)
downloadsamba-f3de07503af29e5593255324fb1f901e878dc776.tar.gz
samba-f3de07503af29e5593255324fb1f901e878dc776.tar.bz2
samba-f3de07503af29e5593255324fb1f901e878dc776.zip
r23151: Re-arrange the logic so it looks identical to the
"file existed" case above. This has no functional change but is easier to see that it's doing the same thing. Jeremy. (This used to be commit 0a7d8362be8379b77e6afb803ab88d726ae7877d)
-rw-r--r--source3/smbd/open.c22
1 files changed, 14 insertions, 8 deletions
diff --git a/source3/smbd/open.c b/source3/smbd/open.c
index ccd12c6946..987da7a94d 100644
--- a/source3/smbd/open.c
+++ b/source3/smbd/open.c
@@ -1663,6 +1663,20 @@ NTSTATUS open_file_ntcreate(connection_struct *conn,
access_mask, share_access,
create_options, &file_existed);
+ if (NT_STATUS_IS_OK(status)) {
+ /* We might be going to allow this open. Check oplock
+ * status again. */
+ /* Second pass - send break for both batch or
+ * exclusive oplocks. */
+ 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;
+ }
+ }
+
if (!NT_STATUS_IS_OK(status)) {
struct deferred_open_record state;
@@ -1686,14 +1700,6 @@ 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*.....
*/