From: Ralph Boehme Date: Sat, 22 Mar 2025 15:59:07 +0000 (+0100) Subject: smbd: fix handling of directory leases and oplock levels X-Git-Tag: samba-4.22.1~32 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a2f2a714848d2257a7abe1e487b455e0caeb7526;p=thirdparty%2Fsamba.git smbd: fix handling of directory leases and oplock levels BUG: https://bugzilla.samba.org/show_bug.cgi?id=15836 Signed-off-by: Ralph Boehme Reviewed-by: Stefan Metzmacher Autobuild-User(master): Ralph Böhme Autobuild-Date(master): Fri Mar 28 07:53:25 UTC 2025 on atb-devel-224 (cherry picked from commit 4b3f45e13f9c11920924c034a457ea2cb8e15e18) Autobuild-User(v4-22-test): Jule Anger Autobuild-Date(v4-22-test): Fri Mar 28 14:53:26 UTC 2025 on atb-devel-224 --- diff --git a/selftest/knownfail.d/samba3.smb2.dirlease b/selftest/knownfail.d/samba3.smb2.dirlease deleted file mode 100644 index 0aa9d23a57a..00000000000 --- a/selftest/knownfail.d/samba3.smb2.dirlease +++ /dev/null @@ -1 +0,0 @@ -^samba3.smb2.dirlease.oplocks\(fileserver\) diff --git a/source3/smbd/open.c b/source3/smbd/open.c index 771734f6203..540dc7a0c60 100644 --- a/source3/smbd/open.c +++ b/source3/smbd/open.c @@ -5191,6 +5191,13 @@ static NTSTATUS open_directory(connection_struct *conn, keep_locked = true; } + if ((oplock_request != NO_OPLOCK) && (oplock_request != LEASE_OPLOCK)) { + /* + * No oplocks on directories, only leases + */ + oplock_request = NO_OPLOCK; + } + lck_state = (struct open_ntcreate_lock_state) { .fsp = fsp, .object_type = "directory",