s3: delete requests are not special
authorVolker Lendecke <vl@samba.org>
Mon, 10 Sep 2012 09:25:03 +0000 (11:25 +0200)
committerKarolin Seeger <kseeger@samba.org>
Tue, 11 Sep 2012 07:27:49 +0000 (09:27 +0200)
The only difference between batch and exclusive oplocks is the time of
the check: Batch is checked before the share mode check, exclusive after.

Signed-off-by: Jeremy Allison <jra@samba.org>
Fix bug #9150 - Valid open requests can cause smbd assert due to incorrect
oplock handling on delete requests.

source3/smbd/open.c

index 3100ad018766698103accca36f67f3819b6cb79e..7d6a25ff2965c2995d3531eaff781502536428fb 100644 (file)
@@ -934,11 +934,6 @@ static NTSTATUS open_mode_check(connection_struct *conn,
        return NT_STATUS_OK;
 }
 
-static bool is_delete_request(files_struct *fsp) {
-       return ((fsp->access_mask == DELETE_ACCESS) &&
-               (fsp->oplock_type == NO_OPLOCK));
-}
-
 /*
  * Send a break message to the oplock holder and delay the open for
  * our client.
@@ -1083,13 +1078,8 @@ static bool delay_for_exclusive_oplocks(files_struct *fsp,
        }
 
        if (ex_entry != NULL) {
-               /* Found an exclusive or batch oplock */
-               bool delay_it = is_delete_request(fsp) ?
-                               BATCH_OPLOCK_TYPE(ex_entry->op_type) : true;
-               if (delay_it) {
-                       send_break_message(fsp, ex_entry, mid, oplock_request);
-                       return true;
-               }
+               send_break_message(fsp, ex_entry, mid, oplock_request);
+               return true;
        }
        return false;
 }