]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
s3:smbd: prepare delay_for_oplock() for directories
authorStefan Metzmacher <metze@samba.org>
Fri, 19 Aug 2022 10:00:15 +0000 (12:00 +0200)
committerJeremy Allison <jra@samba.org>
Tue, 20 Sep 2022 00:34:35 +0000 (00:34 +0000)
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 <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
source3/smbd/open.c

index 4b22a0a703d7268b6121ba1ed4811dd900f0981d..0c4d399561676dd89884c713aa5d15283e299a16 100644 (file)
@@ -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) {
                        /*