smb2_server: optimize SMB2_OP_KEEPALIVE (SMB2 Echo)
authorStefan Metzmacher <metze@samba.org>
Tue, 14 Feb 2023 13:45:26 +0000 (13:45 +0000)
committerStefan Metzmacher <metze@samba.org>
Thu, 1 Jun 2023 07:20:31 +0000 (07:20 +0000)
This is not strictly needed, but it helps profiling
the core smb2_server.c code with the 'smb2.bench.echo'
test.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
source3/smbd/smb2_server.c

index 39d0e80f5915069154dfcd350b336214158bdd55..d768c0b0f8437756adae33e94def596373c8949f 100644 (file)
@@ -135,7 +135,6 @@ static const struct smbd_smb2_dispatch_table {
                .as_root = true,
        },{
                .opcode = SMB2_OP_KEEPALIVE,
-               .as_root = true,
        },{
                .opcode = SMB2_OP_QUERY_DIRECTORY,
                .need_session = true,
@@ -3415,7 +3414,7 @@ skipped_signing:
                SMB_ASSERT(call->fileid_ofs == 0);
                /* This call needs to be run as root */
                change_to_root_user();
-       } else {
+       } else if (opcode != SMB2_OP_KEEPALIVE) {
                SMB_ASSERT(call->need_tcon);
        }