summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVolker Lendecke <vl@samba.org>2013-10-22 11:33:42 +0000
committerStefan Metzmacher <metze@samba.org>2013-10-23 12:11:53 +0200
commitd9a1d54b7916462da5ee7b1ec8208f629d12f2df (patch)
tree70ce72db284cc9b24a0e65e80cc86fed0c5f40f7
parent6c3b41cfc24fca4a1786604102d1163d2fc0a20c (diff)
downloadsamba-d9a1d54b7916462da5ee7b1ec8208f629d12f2df.tar.gz
samba-d9a1d54b7916462da5ee7b1ec8208f629d12f2df.tar.bz2
samba-d9a1d54b7916462da5ee7b1ec8208f629d12f2df.zip
smbd: Use MSG_SMB_BREAK_REQUEST for async l2 breaks
Now that we transmit the level we want to break to via the msg.op_type we can unify MSG_SMB_BREAK_REQUEST and MSG_SMB_ASYNC_LEVEL2_BREAK and thus simplify the code a bit. Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
-rw-r--r--source3/smbd/oplock.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/source3/smbd/oplock.c b/source3/smbd/oplock.c
index f1b89b4650..3eaf1268b8 100644
--- a/source3/smbd/oplock.c
+++ b/source3/smbd/oplock.c
@@ -577,8 +577,14 @@ static void process_oplock_break_message(struct messaging_context *msg_ctx,
OPLOCKLEVEL_II : OPLOCKLEVEL_NONE);
}
+ if ((fsp->oplock_type == LEVEL_II_OPLOCK) && (break_to == NO_OPLOCK)) {
+ /*
+ * This is an async break without a reply and thus no timeout
+ */
+ remove_oplock(fsp);
+ return;
+ }
fsp->sent_oplock_break = break_to_level2 ? LEVEL_II_BREAK_SENT:BREAK_TO_NONE_SENT;
-
add_oplock_timeout_handler(fsp);
}
@@ -767,9 +773,11 @@ static void do_break_to_none(struct tevent_context *ctx,
}
share_mode_entry_to_message(msg, share_entry);
+ /* Overload entry->op_type */
+ SSVAL(msg,OP_BREAK_MSG_OP_TYPE_OFFSET, NO_OPLOCK);
messaging_send_buf(state->sconn->msg_ctx, share_entry->pid,
- MSG_SMB_ASYNC_LEVEL2_BREAK,
+ MSG_SMB_BREAK_REQUEST,
(uint8 *)msg, sizeof(msg));
}