Pass more SMB2 oplock tests. Only oplock stream tests left to fix.
authorJeremy Allison <jra@samba.org>
Wed, 12 May 2010 22:19:45 +0000 (15:19 -0700)
committerJeremy Allison <jra@samba.org>
Wed, 12 May 2010 22:19:45 +0000 (15:19 -0700)
Jeremy.

source3/smbd/oplock.c
source3/smbd/smb2_break.c

index d00bcba32a2caa04a744474be9a25d435d5e072c..1ff1737a3f70bca4a2a80a65a25d348ce606a39e 100644 (file)
@@ -320,7 +320,10 @@ static void oplock_timeout_handler(struct event_context *ctx,
        TALLOC_FREE(fsp->oplock_timeout);
        DEBUG(0, ("Oplock break failed for file %s -- replying anyway\n",
                  fsp_str_dbg(fsp)));
-       global_client_failed_oplock_break = True;
+       /* Only set this for SMB1.. */
+       if (!smbd_server_conn->allow_smb2) {
+               global_client_failed_oplock_break = True;
+       }
        remove_oplock(fsp);
        reply_to_oplock_break_requests(fsp);
 }
index bd0fc566f03f594b469f63079c596b746981c011..a214da0f265337f470a24d5f65f7066304074efe 100644 (file)
@@ -204,6 +204,12 @@ static struct tevent_req *smbd_smb2_oplock_break_send(TALLOC_CTX *mem_ctx,
                fsp_str_dbg(fsp),
                fsp->fnum ));
 
+       /* Are we awaiting a break message ? */
+       if (fsp->oplock_timeout == NULL) {
+               tevent_req_nterror(req, NT_STATUS_INVALID_OPLOCK_PROTOCOL);
+               return tevent_req_post(req, ev);
+       }
+
        if ((fsp->sent_oplock_break == BREAK_TO_NONE_SENT) ||
                        (break_to_none)) {
                result = remove_oplock(fsp);