summaryrefslogtreecommitdiff
path: root/source3/smbd/open.c
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2006-05-30 05:08:15 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 11:17:14 -0500
commit41f139c0bbe02ac4abe15d1e540fe9bff8cff5a5 (patch)
tree69b6506dd34e80455baa7ab6e72647d77b4c4644 /source3/smbd/open.c
parent0a1ca7fa3d19f46c4bcb0c80c78a619c90fe5f2a (diff)
downloadsamba-41f139c0bbe02ac4abe15d1e540fe9bff8cff5a5.tar.gz
samba-41f139c0bbe02ac4abe15d1e540fe9bff8cff5a5.tar.bz2
samba-41f139c0bbe02ac4abe15d1e540fe9bff8cff5a5.zip
r15949: Patch for bug #3308 to stop us returning duplicate
mid replies on path based set-eof trans2 calls. Needs modification for HEAD (as in head open_file_ntcreateX properly returns NTSTATUS - I'll fix this tomorrow my time). Secondly it still fails the Samba4 RAW-OPLOCK smbtorture because of an interesting case. Our oplock code always returns "break to level 2" if it can. In this case (path-based set-eof or set-allocation size on an exclusive oplocked file) W2K3 always sends a break-to-none. We send the break to none (from level2) after we've done the write for eof or allocation size. I need to work out some way of telling our break code to always break to none (might need to extend the message field). Jeremy. (This used to be commit ad9895c654f400e242adcd4099f7cd004521ee92)
Diffstat (limited to 'source3/smbd/open.c')
-rw-r--r--source3/smbd/open.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/source3/smbd/open.c b/source3/smbd/open.c
index f1d1b776dd..5b615f01e2 100644
--- a/source3/smbd/open.c
+++ b/source3/smbd/open.c
@@ -599,7 +599,7 @@ static BOOL is_delete_request(files_struct *fsp) {
}
/*
- * 1) No files open at all: Grant whatever the client wants.
+ * 1) No files open at all or internal open: Grant whatever the client wants.
*
* 2) Exclusive (or batch) oplock around: If the requested access is a delete
* request, break if the oplock around is a batch oplock. If it's another
@@ -608,7 +608,10 @@ static BOOL is_delete_request(files_struct *fsp) {
* 3) Only level2 around: Grant level2 and do nothing else.
*/
-static BOOL delay_for_oplocks(struct share_mode_lock *lck, files_struct *fsp, int pass_number)
+static BOOL delay_for_oplocks(struct share_mode_lock *lck,
+ files_struct *fsp,
+ int pass_number,
+ BOOL internal_only_open)
{
int i;
struct share_mode_entry *exclusive = NULL;
@@ -616,7 +619,7 @@ static BOOL delay_for_oplocks(struct share_mode_lock *lck, files_struct *fsp, in
BOOL delay_it = False;
BOOL have_level2 = False;
- if (is_stat_open(fsp->access_mask)) {
+ if (internal_only_open || is_stat_open(fsp->access_mask)) {
fsp->oplock_type = NO_OPLOCK;
return False;
}
@@ -1367,7 +1370,7 @@ files_struct *open_file_ntcreate(connection_struct *conn,
}
/* First pass - send break only on batch oplocks. */
- if (delay_for_oplocks(lck, fsp, 1)) {
+ if (delay_for_oplocks(lck, fsp, 1, internal_only_open)) {
schedule_defer_open(lck, request_time);
TALLOC_FREE(lck);
return NULL;
@@ -1380,7 +1383,7 @@ files_struct *open_file_ntcreate(connection_struct *conn,
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)) {
+ if (delay_for_oplocks(lck, fsp, 2, internal_only_open)) {
schedule_defer_open(lck, request_time);
TALLOC_FREE(lck);
return NULL;