From 0a8619c8458fe1ab3445b9b6b22ec8ffd86e9e06 Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Fri, 19 Aug 2022 12:00:15 +0200 Subject: [PATCH] s3:smbd: prepare delay_for_oplock() for directories We don't support directory leases yet, so it should be an noop for now. The point is that we want to call delay_for_oplock(oplock_request=NO_OPLOCK) for directories soon. BUG: https://bugzilla.samba.org/show_bug.cgi?id=15125 Signed-off-by: Stefan Metzmacher Reviewed-by: Jeremy Allison --- source3/smbd/open.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/source3/smbd/open.c b/source3/smbd/open.c index 4b22a0a703d..0c4d3995616 100644 --- a/source3/smbd/open.c +++ b/source3/smbd/open.c @@ -2745,6 +2745,17 @@ static NTSTATUS delay_for_oplock(files_struct *fsp, *poplock_type = NO_OPLOCK; *pgranted = 0; + if (fsp->fsp_flags.is_directory) { + /* + * No directory leases yet + */ + SMB_ASSERT(oplock_request == NO_OPLOCK); + if (have_sharing_violation) { + return NT_STATUS_SHARING_VIOLATION; + } + return NT_STATUS_OK; + } + if (oplock_request == LEASE_OPLOCK) { if (lease == NULL) { /*