Ensure we send the direct levelII oplock break to the correct fid.
authorPavel Shilovsky <piastry@etersoft.ru>
Mon, 31 Jan 2011 22:52:11 +0000 (14:52 -0800)
committerJeremy Allison <jra@samba.org>
Mon, 31 Jan 2011 23:39:56 +0000 (00:39 +0100)
Autobuild-User: Jeremy Allison <jra@samba.org>
Autobuild-Date: Tue Feb  1 00:39:56 CET 2011 on sn-devel-104

source3/smbd/oplock.c

index 31cedc415e3800a6efabf398e215ab4491656925..c3c41d1c33955db20ea0e8d005531a5f03ad4202 100644 (file)
@@ -839,8 +839,17 @@ static void contend_level2_oplocks_begin_default(files_struct *fsp,
                 */
 
                if (procid_is_me(&share_entry->pid)) {
+                       struct files_struct *cur_fsp =
+                               initial_break_processing(fsp->conn->sconn,
+                                       share_entry->id,
+                                       share_entry->share_file_id);
                        wait_before_sending_break();
-                       break_level2_to_none_async(fsp);
+                       if (cur_fsp != NULL) {
+                               break_level2_to_none_async(cur_fsp);
+                       } else {
+                               DEBUG(3, ("release_level_2_oplocks_on_change: "
+                               "Did not find fsp, ignoring\n"));
+                       }
                } else {
                        messaging_send_buf(fsp->conn->sconn->msg_ctx,
                                        share_entry->pid,