From: Stefan Metzmacher Date: Tue, 14 Feb 2023 13:45:26 +0000 (+0000) Subject: smb2_server: optimize SMB2_OP_KEEPALIVE (SMB2 Echo) X-Git-Tag: talloc-2.4.1~514 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a08f8b2a2cc1ba8f7246375d2d697ce979281402;p=thirdparty%2Fsamba.git smb2_server: optimize SMB2_OP_KEEPALIVE (SMB2 Echo) 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 Reviewed-by: Volker Lendecke --- diff --git a/source3/smbd/smb2_server.c b/source3/smbd/smb2_server.c index 39d0e80f591..d768c0b0f84 100644 --- a/source3/smbd/smb2_server.c +++ b/source3/smbd/smb2_server.c @@ -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); }