remove from global oplock vars on durable close
authorMichael Adam <obnox@samba.org>
Thu, 23 Feb 2012 15:26:39 +0000 (16:26 +0100)
committerStefan Metzmacher <metze@samba.org>
Thu, 10 May 2012 16:42:00 +0000 (18:42 +0200)
source3/smbd/close.c

index 3d621124ed516f7fd8e6af2c5e8721b16c150930..08acd508af74e66811de5bb172af2cdcd4fc70e0 100644 (file)
@@ -715,6 +715,15 @@ static NTSTATUS close_normal_file(struct smb_request *req, files_struct *fsp,
                        tmp = close_filestruct(fsp);
                        status = ntstatus_keeperror(status, tmp);
 
+                       if (fsp->oplock_type == LEVEL_II_OPLOCK) {
+                               level_II_oplocks_open--;
+                       } else if (EXCLUSIVE_OPLOCK_TYPE(fsp->oplock_type)) {
+                               exclusive_oplocks_open--;
+                       }
+
+                       SMB_ASSERT(exclusive_oplocks_open>=0);
+                       SMB_ASSERT(level_II_oplocks_open>=0);
+
                        TALLOC_FREE(lck);
 
                        tmp = fd_close(fsp);