[SCM] Samba Shared Repository - branch v3-6-test updated

Karolin Seeger kseeger at samba.org
Tue Jul 12 13:08:26 MDT 2011


The branch, v3-6-test has been updated
       via  b7dbbe1 Fix bug #8293 - SMB2 doesn't rotate the log files often enough.
      from  9a555e0 s3-waf: split out LIBCLI_WINREG_INTERNAL as LIBCLI_WINREG was pulling in rpc server code in undesired places.

http://gitweb.samba.org/?p=samba.git;a=shortlog;h=v3-6-test


- Log -----------------------------------------------------------------
commit b7dbbe1005627932ab959144002f9d41adb04328
Author: Jeremy Allison <jra at samba.org>
Date:   Thu Jul 7 14:59:41 2011 -0700

    Fix bug #8293 - SMB2 doesn't rotate the log files often enough.
    
    Move the num_requests field out of the smb1 struct into the generic
    struct smbd_server_connection struct. Use it to count SMB2 requests
    as well as SMB1 and ensure that check_log_size() is called every 50
    SMB2 requests.

-----------------------------------------------------------------------

Summary of changes:
 source3/smbd/globals.h     |    3 ++-
 source3/smbd/process.c     |    4 ++--
 source3/smbd/smb2_server.c |   17 +++++++++++++++++
 3 files changed, 21 insertions(+), 3 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source3/smbd/globals.h b/source3/smbd/globals.h
index 97d75fd..d9a54d2 100644
--- a/source3/smbd/globals.h
+++ b/source3/smbd/globals.h
@@ -483,6 +483,8 @@ struct smbd_server_connection {
 		int dirhandles_open;
 	} searches;
 
+	uint64_t num_requests;
+
 	struct {
 		struct fd_event *fde;
 
@@ -510,7 +512,6 @@ struct smbd_server_connection {
 			int ref_count;
 		} echo_handler;
 
-		uint64_t num_requests;
 		struct {
 			bool encrypted_passwords;
 			bool spnego;
diff --git a/source3/smbd/process.c b/source3/smbd/process.c
index ea4c36b..c03ca45 100644
--- a/source3/smbd/process.c
+++ b/source3/smbd/process.c
@@ -1689,7 +1689,7 @@ static void process_smb(struct smbd_server_connection *sconn,
 	sconn->trans_num++;
 
 done:
-	sconn->smb1.num_requests++;
+	sconn->num_requests++;
 
 	/* The timeout_processing function isn't run nearly
 	   often enough to implement 'max log size' without
@@ -1698,7 +1698,7 @@ done:
 	   level 10.  Checking every 50 SMBs is a nice
 	   tradeoff of performance vs log file size overrun. */
 
-	if ((sconn->smb1.num_requests % 50) == 0 &&
+	if ((sconn->num_requests % 50) == 0 &&
 	    need_to_check_log_size()) {
 		change_to_root_user();
 		check_log_size();
diff --git a/source3/smbd/smb2_server.c b/source3/smbd/smb2_server.c
index 0944e57..416e3c1 100644
--- a/source3/smbd/smb2_server.c
+++ b/source3/smbd/smb2_server.c
@@ -2214,6 +2214,8 @@ void smbd_smb2_first_negprot(struct smbd_server_connection *sconn,
 		return;
 	}
 	tevent_req_set_callback(subreq, smbd_smb2_request_incoming, sconn);
+
+	sconn->num_requests++;
 }
 
 static void smbd_smb2_request_incoming(struct tevent_req *subreq)
@@ -2270,4 +2272,19 @@ next:
 		return;
 	}
 	tevent_req_set_callback(subreq, smbd_smb2_request_incoming, sconn);
+
+	sconn->num_requests++;
+
+	/* The timeout_processing function isn't run nearly
+	   often enough to implement 'max log size' without
+	   overrunning the size of the file by many megabytes.
+	   This is especially true if we are running at debug
+	   level 10.  Checking every 50 SMB2s is a nice
+	   tradeoff of performance vs log file size overrun. */
+
+	if ((sconn->num_requests % 50) == 0 &&
+	    need_to_check_log_size()) {
+		change_to_root_user();
+		check_log_size();
+	}
 }


-- 
Samba Shared Repository


More information about the samba-cvs mailing list