[Pkg-samba-maint] [samba] 117/135: s3:smb2_server: avoid calling set_current_user_info() for each request
Ivo De Decker
ivodd at moszumanska.debian.org
Sat Jan 11 21:30:31 UTC 2014
This is an automated email from the git hooks/post-receive script.
ivodd pushed a commit to branch master
in repository samba.
commit 723d74ff63e0397735013326df93354533db5606
Author: Stefan Metzmacher <metze at samba.org>
Date: Tue Nov 19 05:21:05 2013 +0100
s3:smb2_server: avoid calling set_current_user_info() for each request
Signed-off-by: Stefan Metzmacher <metze at samba.org>
Reviewed-by: David Disseldorp <ddiss at samba.org>
Autobuild-User(master): Stefan Metzmacher <metze at samba.org>
Autobuild-Date(master): Wed Nov 27 16:31:44 CET 2013 on sn-devel-104
(cherry picked from commit 3cc0651d9feda00b6a04f84b76744b2acc3a0446)
The last 6 patches address bug #10298 - smb2_server processing overhead.
---
source3/smbd/globals.h | 2 +-
source3/smbd/process.c | 5 ++---
source3/smbd/smb2_server.c | 9 ++++++---
3 files changed, 9 insertions(+), 7 deletions(-)
diff --git a/source3/smbd/globals.h b/source3/smbd/globals.h
index 1662a84..df0e524 100644
--- a/source3/smbd/globals.h
+++ b/source3/smbd/globals.h
@@ -367,6 +367,7 @@ struct smbXsrv_connection {
* this session_table is used for SMB1 and SMB2,
*/
struct smbXsrv_session_table *session_table;
+ uint64_t last_session_id;
/*
* this tcon_table is only used for SMB1.
*/
@@ -731,7 +732,6 @@ struct smbd_server_connection {
* Set by us for CORE protocol.
*/
int max_send;
- uint64_t last_session_tag;
} sessions;
struct smb_signing_state *signing_state;
diff --git a/source3/smbd/process.c b/source3/smbd/process.c
index 5ef0fd3..706d701 100644
--- a/source3/smbd/process.c
+++ b/source3/smbd/process.c
@@ -1435,10 +1435,10 @@ static connection_struct *switch_message(uint8 type, struct smb_request *req)
}
}
- if (session_tag != sconn->smb1.sessions.last_session_tag) {
+ if (session_tag != sconn->conn->last_session_id) {
struct user_struct *vuser = NULL;
- sconn->smb1.sessions.last_session_tag = session_tag;
+ sconn->conn->last_session_id = session_tag;
if (session) {
vuser = session->compat;
}
@@ -3595,7 +3595,6 @@ void smbd_process(struct tevent_context *ev_ctx,
sconn->smb1.sessions.done_sesssetup = false;
sconn->smb1.sessions.max_send = BUFFER_SIZE;
- sconn->smb1.sessions.last_session_tag = UID_FIELD_INVALID;
if (!init_dptrs(sconn)) {
exit_server("init_dptrs() failed");
diff --git a/source3/smbd/smb2_server.c b/source3/smbd/smb2_server.c
index 3564a9b..e5f7de3 100644
--- a/source3/smbd/smb2_server.c
+++ b/source3/smbd/smb2_server.c
@@ -1749,9 +1749,12 @@ static NTSTATUS smbd_smb2_request_check_session(struct smbd_smb2_request *req)
return NT_STATUS_INVALID_HANDLE;
}
- set_current_user_info(session_info->unix_info->sanitized_username,
- session_info->unix_info->unix_name,
- session_info->info->domain_name);
+ if (in_session_id != req->sconn->conn->last_session_id) {
+ req->sconn->conn->last_session_id = in_session_id;
+ set_current_user_info(session_info->unix_info->sanitized_username,
+ session_info->unix_info->unix_name,
+ session_info->info->domain_name);
+ }
return NT_STATUS_OK;
}
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-samba/samba.git
More information about the Pkg-samba-maint
mailing list