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: tevent-0.17.0~451 X-Git-Url: http://git.ipfire.org/gitweb/gitweb.cgi?a=commitdiff_plain;h=4b3f45e13f9c11920924c034a457ea2cb8e15e18;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 --- 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 a9e68bad468..25f54428bb1 100644 --- a/source3/smbd/open.c +++ b/source3/smbd/open.c @@ -5165,6 +5165,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",