Trying to track down the SMB2 error. Add an invariant test.
authorJeremy Allison <jra@samba.org>
Fri, 15 Apr 2011 23:30:17 +0000 (16:30 -0700)
committerJeremy Allison <jra@samba.org>
Sat, 16 Apr 2011 00:15:38 +0000 (02:15 +0200)
Autobuild-User: Jeremy Allison <jra@samba.org>
Autobuild-Date: Sat Apr 16 02:15:38 CEST 2011 on sn-devel-104

source3/locking/locking.c

index 28f1aceb499f4d228c9ee8900ac50c887fed1f5e..f5892ddf0d7d431a33a6fa03eab83d257c5e7de7 100644 (file)
@@ -1376,12 +1376,15 @@ bool remove_share_oplock(struct share_mode_lock *lck, files_struct *fsp)
                return False;
        }
 
                return False;
        }
 
-       if (EXCLUSIVE_OPLOCK_TYPE(fsp->oplock_type)) {
+       if (EXCLUSIVE_OPLOCK_TYPE(e->op_type)) {
                /*
                 * Going from exclusive or batch,
                 * we always go through FAKE_LEVEL_II
                 * first.
                 */
                /*
                 * Going from exclusive or batch,
                 * we always go through FAKE_LEVEL_II
                 * first.
                 */
+               if (!EXCLUSIVE_OPLOCK_TYPE(fsp->oplock_type)) {
+                       smb_panic("remove_share_oplock: logic error");
+               }
                e->op_type = FAKE_LEVEL_II_OPLOCK;
        } else {
                e->op_type = NO_OPLOCK;
                e->op_type = FAKE_LEVEL_II_OPLOCK;
        } else {
                e->op_type = NO_OPLOCK;