From: Ralph Boehme Date: Fri, 6 Sep 2024 10:28:46 +0000 (+0200) Subject: smbd: allow directory leases in close_directory() X-Git-Tag: tdb-1.4.13~687 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0da7b1b820a31874a381fd5dc4e7e5e5dfc00661;p=thirdparty%2Fsamba.git smbd: allow directory leases in close_directory() Signed-off-by: Ralph Boehme Reviewed-by: Stefan Metzmacher --- 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