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

Karolin Seeger kseeger at samba.org
Wed Jun 13 11:39:53 MDT 2012


The branch, v3-6-test has been updated
       via  8b3b1aa We are triggering the cleanup_timeout_fn() too often, on exiting when an smbd is idle.
       via  777ac04 Stop spamming the logs with "Could not remove pid XX from serverid.tdb" messages and initiating the cleanup function on every process deat
      from  445f314 s3: Fix uninitialized memory read in talloc_free()

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


- Log -----------------------------------------------------------------
commit 8b3b1aa4ff76d7f03285e3fa87f30f3068a7ea5d
Author: Jeremy Allison <jra at samba.org>
Date:   Fri Jun 1 12:28:33 2012 -0700

    We are triggering the cleanup_timeout_fn() too often, on exiting when an smbd is idle.
    
    Calls to exit_server_cleanly() should be treated as a "clean" shutdown,
    and not trigger the master smbd to call cleanup_timeout_fn.
    
    The last 2 patches address bug #8971 (cleanup_timeout_fn() is called too often,
    on exiting when an smbd is idle.)

commit 777ac04a99467594805a03635b04011c495ff7e7
Author: Jeremy Allison <jra at samba.org>
Date:   Fri Jun 1 12:02:04 2012 -0700

    Stop spamming the logs with "Could not remove pid XX from serverid.tdb" messages and initiating the cleanup function on every process deat
    
    We now have many sub-processes from smbd that don't serve SMB1/SMB2 requests and
    don't register themselves in the serverid.tdb. Only initiate the cleanup
    from processes that were explicitly in the child list.

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

Summary of changes:
 source3/smbd/server.c      |   35 +++++++++++++++++++----------------
 source3/smbd/server_exit.c |   15 ++++-----------
 2 files changed, 23 insertions(+), 27 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source3/smbd/server.c b/source3/smbd/server.c
index 8cda180..9a8cdc0 100644
--- a/source3/smbd/server.c
+++ b/source3/smbd/server.c
@@ -283,6 +283,25 @@ static void remove_child_pid(pid_t pid, bool unclean_shutdown)
 	static struct timed_event *cleanup_te;
 	struct server_id child_id;
 
+	child_id = procid_self(); /* Just initialize pid and potentially vnn */
+	child_id.pid = pid;
+
+	for (child = children; child != NULL; child = child->next) {
+		if (child->pid == pid) {
+			struct child_pid *tmp = child;
+			DLIST_REMOVE(children, child);
+			SAFE_FREE(tmp);
+			num_children -= 1;
+			break;
+		}
+	}
+
+	if (child == NULL) {
+		/* not all forked child processes are added to the children list */
+		DEBUG(2, ("Could not find child %d -- ignoring\n", (int)pid));
+		return;
+	}
+
 	if (unclean_shutdown) {
 		/* a child terminated uncleanly so tickle all
 		   processes to see if they can grab any of the
@@ -301,26 +320,10 @@ static void remove_child_pid(pid_t pid, bool unclean_shutdown)
 		}
 	}
 
-	child_id = procid_self(); /* Just initialize pid and potentially vnn */
-	child_id.pid = pid;
-
 	if (!serverid_deregister(child_id)) {
 		DEBUG(1, ("Could not remove pid %d from serverid.tdb\n",
 			  (int)pid));
 	}
-
-	for (child = children; child != NULL; child = child->next) {
-		if (child->pid == pid) {
-			struct child_pid *tmp = child;
-			DLIST_REMOVE(children, child);
-			SAFE_FREE(tmp);
-			num_children -= 1;
-			return;
-		}
-	}
-
-	/* not all forked child processes are added to the children list */
-	DEBUG(1, ("Could not find child %d -- ignoring\n", (int)pid));
 }
 
 /****************************************************************************
diff --git a/source3/smbd/server_exit.c b/source3/smbd/server_exit.c
index 4c71d8f..fc77dee 100644
--- a/source3/smbd/server_exit.c
+++ b/source3/smbd/server_exit.c
@@ -83,7 +83,6 @@ static void exit_server_common(enum server_exit_reason how,
 static void exit_server_common(enum server_exit_reason how,
 	const char *const reason)
 {
-	bool had_open_conn = false;
 	struct smbd_server_connection *sconn = smbd_server_conn;
 
 	if (!exit_firsttime)
@@ -101,7 +100,7 @@ static void exit_server_common(enum server_exit_reason how,
 			bool found = false;
 			files_forall(sconn, log_writeable_file_fn, &found);
 		}
-		had_open_conn = conn_close_all(sconn);
+		(void)conn_close_all(sconn);
 		invalidate_all_vuids(sconn);
 	}
 
@@ -175,6 +174,8 @@ static void exit_server_common(enum server_exit_reason how,
 
 		dump_core();
 
+		/* Notreached. */
+		exit(1);
 	} else {
 		DEBUG(3,("Server exit (%s)\n",
 			(reason ? reason : "normal exit")));
@@ -184,15 +185,7 @@ static void exit_server_common(enum server_exit_reason how,
 		gencache_stabilize();
 	}
 
-	/* if we had any open SMB connections when we exited then we
-	   need to tell the parent smbd so that it can trigger a retry
-	   of any locks we may have been holding or open files we were
-	   blocking */
-	if (had_open_conn) {
-		exit(1);
-	} else {
-		exit(0);
-	}
+	exit(0);
 }
 
 void exit_server(const char *const explanation)


-- 
Samba Shared Repository


More information about the samba-cvs mailing list