summaryrefslogtreecommitdiff
path: root/source3/smbd/open.c
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2007-05-26 01:19:51 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 12:22:49 -0500
commit4c795b293d34db5fa334c7627fa86d0ed197adcb (patch)
treec6a1fe978fdf3d0a8875f51b3900e3c4e7b878c9 /source3/smbd/open.c
parent4d6caa09e2b8c1c26f3dde832586d871bbbc2dda (diff)
downloadsamba-4c795b293d34db5fa334c7627fa86d0ed197adcb.tar.gz
samba-4c795b293d34db5fa334c7627fa86d0ed197adcb.tar.bz2
samba-4c795b293d34db5fa334c7627fa86d0ed197adcb.zip
r23150: Fix Samba3 in the build farm again. In the case where the
file was being created and we go into the race condition check, we were testing for compatible open modes, but were not breaking oplocks in the same way as if the file existed. This meant that we weren't going into the code path that sets fsp->oplock = FAKE_LEVEL_II_OPLOCK if the client didn't ask for an oplock on file create. We need to do this as internally it's what Windows does. Jeremy. (This used to be commit 9b9513856e9e9f84d5acd94e3e3d6e73358ee7dc)
Diffstat (limited to 'source3/smbd/open.c')
-rw-r--r--source3/smbd/open.c17
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*.....
*/