From 0da7b1b820a31874a381fd5dc4e7e5e5dfc00661 Mon Sep 17 00:00:00 2001 From: Ralph Boehme Date: Fri, 6 Sep 2024 12:28:46 +0200 Subject: [PATCH] smbd: allow directory leases in close_directory() Signed-off-by: Ralph Boehme Reviewed-by: Stefan Metzmacher --- source3/smbd/close.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/source3/smbd/close.c b/source3/smbd/close.c index 1b83bae580f..603a4c01e7e 100644 --- a/source3/smbd/close.c +++ b/source3/smbd/close.c @@ -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 -- 2.47.3