smbd: Assert that INTERNAL_OPEN_ONLY never gets real oplocks
authorVolker Lendecke <vl@samba.org>
Tue, 6 Aug 2019 15:27:12 +0000 (17:27 +0200)
committerJeremy Allison <jra@samba.org>
Tue, 6 Aug 2019 23:06:41 +0000 (23:06 +0000)
Slightly simplify assumptions in the code

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Tue Aug  6 23:06:41 UTC 2019 on sn-devel-184

source3/smbd/open.c

index a90bca2cea1e0f7b419e69748aaad6171515f312..c75754d1e16c20c50c132d73b138056973d75836 100644 (file)
@@ -2999,7 +2999,7 @@ static NTSTATUS open_file_ntcreate(connection_struct *conn,
 
        if (req == NULL) {
                /* Ensure req == NULL means INTERNAL_OPEN_ONLY */
-               SMB_ASSERT(((oplock_request & INTERNAL_OPEN_ONLY) != 0));
+               SMB_ASSERT(oplock_request == INTERNAL_OPEN_ONLY);
        } else {
                /* And req != NULL means no INTERNAL_OPEN_ONLY */
                SMB_ASSERT(((oplock_request & INTERNAL_OPEN_ONLY) == 0));