]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
smbd: allow directory leases in close_directory()
authorRalph Boehme <slow@samba.org>
Fri, 6 Sep 2024 10:28:46 +0000 (12:28 +0200)
committerRalph Boehme <slow@samba.org>
Tue, 5 Nov 2024 14:39:30 +0000 (14:39 +0000)
Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
source3/smbd/close.c

index 1b83bae580f20b3d9d561f742a02918b5a99fb7d..603a4c01e7e38a93a7a85efcbc83f8b60ab2b945 100644 (file)
@@ -1536,11 +1536,10 @@ static NTSTATUS close_directory(struct smb_request *req, files_struct *fsp,
                return status;
        }
 
-       /*
-        * We don't have directory leases yet, so assert it in order
-        * to skip release_file_oplock().
-        */
-       SMB_ASSERT(fsp->oplock_type == NO_OPLOCK);
+       /* Remove the oplock before potentially deleting the file. */
+       if (fsp->oplock_type != NO_OPLOCK) {
+               release_file_oplock(fsp);
+       }
 
        /*
         * NT can set delete_on_close of the last open