[SCM] Samba Shared Repository - branch v4-5-test updated

Karolin Seeger kseeger at samba.org
Mon Jun 26 14:58:02 UTC 2017


The branch, v4-5-test has been updated
       via  17543bd ctdb-recovery: Do not run local ip verification when in recovery
       via  fc7b70f ctdb-recovery: Get recmode unconditionally in the main_loop
       via  10a763d ctdb-recovery: Finish processing for recovery mode ACTIVE first
       via  40cc8d2 ctdb-recovery: Simplify logging of recovery mode setting
       via  da97cd2 ctdb-recovery: Setting up of recmode should be idempotent
       via  6c49f54 ctdb-recovery: Assign banning credits if database fails to freeze
       via  6627e19 ctdb-scripts: Don't send empty argument string to logger
       via  46ab108 Bug 15852. There are valid paths where conn->lsa_pipe_tcp->transport is NULL. Protect against this.
       via  16d4fd9 s3:smb2_sesssetup: allow a compound request after a SessionSetup
       via  48ab0c3 s3:smb2_tcon: allow a compound request after a TreeConnect
      from  5336447 libcli:smb2: Gracefully handle not supported for FSCTL_VALIDATE_NEGOTIATE_INFO

https://git.samba.org/?p=samba.git;a=shortlog;h=v4-5-test


- Log -----------------------------------------------------------------
commit 17543bd02cc2f11080e618444cb2250dd5764fda
Author: Amitay Isaacs <amitay at gmail.com>
Date:   Thu Jun 22 16:15:47 2017 +1000

    ctdb-recovery: Do not run local ip verification when in recovery
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=12857
    
    If we drop public IPs because CTDB is in recovery for too long, then
    avoid spamming logs "Trigger takeoverrun" every second.
    
    Signed-off-by: Amitay Isaacs <amitay at gmail.com>
    Reviewed-by: Martin Schwenke <martin at meltin.net>
    (cherry picked from commit ea46699b27ef8d4ac7b5dd07035465cb3df09ea4)
    
    Autobuild-User(v4-5-test): Karolin Seeger <kseeger at samba.org>
    Autobuild-Date(v4-5-test): Mon Jun 26 16:57:51 CEST 2017 on sn-devel-144

commit fc7b70f7703f56922fb9443becb67aac6af96fbe
Author: Amitay Isaacs <amitay at gmail.com>
Date:   Thu Jun 22 17:45:20 2017 +1000

    ctdb-recovery: Get recmode unconditionally in the main_loop
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=12857
    
    This can be used later in the main_loop to avoid the local ip check.
    
    Signed-off-by: Amitay Isaacs <amitay at gmail.com>
    Reviewed-by: Martin Schwenke <martin at meltin.net>
    (cherry picked from commit 2fd2ccd4c8617cfa7374d7a5ee3d1cc61c4fa4ad)

commit 10a763dd1b8917105200edb2161e3c42da86c799
Author: Amitay Isaacs <amitay at gmail.com>
Date:   Thu Jun 22 14:09:32 2017 +1000

    ctdb-recovery: Finish processing for recovery mode ACTIVE first
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=12857
    
    This simplifies the code and avoids complicated conditions.
    
    Signed-off-by: Amitay Isaacs <amitay at gmail.com>
    Reviewed-by: Martin Schwenke <martin at meltin.net>
    (cherry picked from commit f8200153b21f5b19c9a1d57be3e05e739d9fafcd)

commit 40cc8d2b71867e4316472d531502610672f5c98a
Author: Amitay Isaacs <amitay at gmail.com>
Date:   Thu Jun 22 14:52:32 2017 +1000

    ctdb-recovery: Simplify logging of recovery mode setting
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=12857
    
    Signed-off-by: Amitay Isaacs <amitay at gmail.com>
    Reviewed-by: Martin Schwenke <martin at meltin.net>
    (cherry picked from commit d74dadd7f26a9e8c48ba92468d7d0c4a7aa5a8e5)

commit da97cd28c148b0c6e09932d5cd846af278f5b3cb
Author: Amitay Isaacs <amitay at gmail.com>
Date:   Thu Jun 22 14:49:02 2017 +1000

    ctdb-recovery: Setting up of recmode should be idempotent
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=12857
    
    If the recovery mode is already set to the expected value, there is
    nothing to do.
    
    Signed-off-by: Amitay Isaacs <amitay at gmail.com>
    Reviewed-by: Martin Schwenke <martin at meltin.net>
    (cherry picked from commit f2771fcbf438e8b06321752c7203f01bbe33b573)

commit 6c49f5464001efcabcf0e5978ecba0ad1cf36cd7
Author: Amitay Isaacs <amitay at gmail.com>
Date:   Thu Jun 22 14:00:13 2017 +1000

    ctdb-recovery: Assign banning credits if database fails to freeze
    
    https://bugzilla.samba.org/show_bug.cgi?id=12857
    
    Signed-off-by: Amitay Isaacs <amitay at gmail.com>
    Reviewed-by: Martin Schwenke <martin at meltin.net>
    (cherry picked from commit c9d9f56bffe1e19665dba8e0cf899399d3d9fb72)

commit 6627e1928bd0a1228d0b697250777f6bfdac38b2
Author: Amitay Isaacs <amitay at gmail.com>
Date:   Thu Jun 22 14:34:36 2017 +1000

    ctdb-scripts: Don't send empty argument string to logger
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=12856
    
    This stops logger reading from stdin.
    
    Signed-off-by: Amitay Isaacs <amitay at gmail.com>
    Reviewed-by: Martin Schwenke <martin at meltin.net>
    
    Autobuild-User(master): Martin Schwenke <martins at samba.org>
    Autobuild-Date(master): Sat Jun 24 14:37:48 CEST 2017 on sn-devel-144
    
    (cherry picked from commit 2fa069e870c0e6f1daa2a08be5aacac7b1063a5e)

commit 46ab108f193c4737a75c8417447da290fa32be31
Author: Richard Sharpe <richard.sharpe at primarydata.com>
Date:   Tue Jun 20 12:40:39 2017 -0700

    Bug 15852. There are valid paths where conn->lsa_pipe_tcp->transport is NULL. Protect against this.
    
    Based on a suggestion from Metze.
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=12852
    
    Signed-off-by: Richard Sharpe <realrichardsharpe at gmail.com>
    Reviewed-by: Jeremy Allison <jra at samba.org>
    
    Autobuild-User(master): Jeremy Allison <jra at samba.org>
    Autobuild-Date(master): Thu Jun 22 23:16:46 CEST 2017 on sn-devel-144
    
    (cherry picked from commit 03042b85c8140842633b36f3124e504b97b852a1)

commit 16d4fd9371cf05c65c4fa376473760c1a75b1214
Author: Stefan Metzmacher <metze at samba.org>
Date:   Thu Jun 15 23:01:18 2017 +0200

    s3:smb2_sesssetup: allow a compound request after a SessionSetup
    
    This is not a full fix yet as we don't allow compound requests
    after going async.
    
    With SMB 3.11 requiring signed TreeConnect requests it's pointless
    to try to compound requests after a SessionSetup.
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=12845
    
    Signed-off-by: Stefan Metzmacher <metze at samba.org>
    Reviewed-by: Jeremy Allison <jra at samba.org>
    
    Autobuild-User(master): Jeremy Allison <jra at samba.org>
    Autobuild-Date(master): Sat Jun 17 10:55:25 CEST 2017 on sn-devel-144
    
    (cherry picked from commit bb5c394fde03dc8230d5089a66fea1a2541952f5)

commit 48ab0c36a8f4d684e100c04251953bdb2dfa70bc
Author: Stefan Metzmacher <metze at samba.org>
Date:   Thu Jun 15 23:01:18 2017 +0200

    s3:smb2_tcon: allow a compound request after a TreeConnect
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=12844
    
    Signed-off-by: Stefan Metzmacher <metze at samba.org>
    Reviewed-by: Jeremy Allison <jra at samba.org>
    (cherry picked from commit f8974bcdbf8abe3803340dcd20206ff4de9d5079)

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

Summary of changes:
 ctdb/config/functions              |  2 +-
 ctdb/server/ctdb_recover.c         | 31 +++++++++++++++++--------------
 ctdb/server/ctdb_recoverd.c        | 19 ++++++++++++-------
 ctdb/server/ctdb_recovery_helper.c |  1 +
 source3/smbd/smb2_sesssetup.c      |  1 +
 source3/smbd/smb2_tcon.c           |  2 ++
 source3/winbindd/winbindd_cm.c     |  8 +++++---
 7 files changed, 39 insertions(+), 25 deletions(-)


Changeset truncated at 500 lines:

diff --git a/ctdb/config/functions b/ctdb/config/functions
index a29daf5..885289a 100755
--- a/ctdb/config/functions
+++ b/ctdb/config/functions
@@ -150,7 +150,7 @@ script_log ()
 	*)
 	    # Handle all syslog:* variants here too.  There's no tool to do
 	    # the lossy things, so just use logger.
-	    logger -t "ctdbd: ${_tag}" "$*"
+	    logger -t "ctdbd: ${_tag}" "$@"
 	    ;;
     esac
 }
diff --git a/ctdb/server/ctdb_recover.c b/ctdb/server/ctdb_recover.c
index 6bed61c..ea8a0b3 100644
--- a/ctdb/server/ctdb_recover.c
+++ b/ctdb/server/ctdb_recover.c
@@ -856,26 +856,27 @@ int32_t ctdb_control_set_recmode(struct ctdb_context *ctdb,
 	struct set_recmode_state *state;
 	struct ctdb_cluster_mutex_handle *h;
 
+	if (recmode == ctdb->recovery_mode) {
+		DEBUG(DEBUG_INFO,
+		      ("Recovery mode already set to %s\n",
+		       recmode == CTDB_RECOVERY_NORMAL ? "NORMAL" : "ACTIVE"));
+		return 0;
+	}
+
+	DEBUG(DEBUG_NOTICE,
+	      ("Recovery mode set to %s\n",
+	       recmode == CTDB_RECOVERY_NORMAL ? "NORMAL" : "ACTIVE"));
+
 	/* if we enter recovery but stay in recovery for too long
 	   we will eventually drop all our ip addresses
 	*/
-	if (recmode == CTDB_RECOVERY_NORMAL) {
-		talloc_free(ctdb->release_ips_ctx);
-		ctdb->release_ips_ctx = NULL;
-	} else {
+	if (recmode == CTDB_RECOVERY_ACTIVE) {
 		if (ctdb_deferred_drop_all_ips(ctdb) != 0) {
-			DEBUG(DEBUG_ERR,("Failed to set up deferred drop all ips\n"));
+			DEBUG(DEBUG_ERR,
+			      ("Failed to set up deferred drop all ips\n"));
 		}
-	}
 
-	if (recmode != ctdb->recovery_mode) {
-		DEBUG(DEBUG_NOTICE,(__location__ " Recovery mode set to %s\n", 
-			 recmode==CTDB_RECOVERY_NORMAL?"NORMAL":"ACTIVE"));
-	}
-
-	if (recmode != CTDB_RECOVERY_NORMAL ||
-	    ctdb->recovery_mode != CTDB_RECOVERY_ACTIVE) {
-		ctdb->recovery_mode = recmode;
+		ctdb->recovery_mode = CTDB_RECOVERY_ACTIVE;
 		return 0;
 	}
 
@@ -884,6 +885,8 @@ int32_t ctdb_control_set_recmode(struct ctdb_context *ctdb,
 	 * Therefore, what follows is special handling when setting
 	 * recovery mode back to normal */
 
+	TALLOC_FREE(ctdb->release_ips_ctx);
+
 	for (ctdb_db = ctdb->db_list; ctdb_db != NULL; ctdb_db = ctdb_db->next) {
 		if (ctdb_db->generation != ctdb->vnn_map->generation) {
 			DEBUG(DEBUG_ERR,
diff --git a/ctdb/server/ctdb_recoverd.c b/ctdb/server/ctdb_recoverd.c
index d233817..f947ee0 100644
--- a/ctdb/server/ctdb_recoverd.c
+++ b/ctdb/server/ctdb_recoverd.c
@@ -2596,6 +2596,13 @@ static void main_loop(struct ctdb_context *ctdb, struct ctdb_recoverd *rec,
 		return;
 	}
 
+	ret = ctdb_ctrl_getrecmode(ctdb, mem_ctx, CONTROL_TIMEOUT(),
+				   CTDB_CURRENT_NODE, &ctdb->recovery_mode);
+	if (ret != 0) {
+		DEBUG(DEBUG_ERR, ("Failed to read recmode from local node\n"));
+		return;
+	}
+
 	/* if the local daemon is STOPPED or BANNED, we verify that the databases are
 	   also frozen and that the recmode is set to active.
 	*/
@@ -2608,10 +2615,6 @@ static void main_loop(struct ctdb_context *ctdb, struct ctdb_recoverd *rec,
 		 */
 		rec->priority_time = timeval_current();
 
-		ret = ctdb_ctrl_getrecmode(ctdb, mem_ctx, CONTROL_TIMEOUT(), CTDB_CURRENT_NODE, &ctdb->recovery_mode);
-		if (ret != 0) {
-			DEBUG(DEBUG_ERR,(__location__ " Failed to read recmode from local node\n"));
-		}
 		if (ctdb->recovery_mode == CTDB_RECOVERY_NORMAL) {
 			DEBUG(DEBUG_ERR,("Node is stopped or banned but recovery mode is not active. Activate recovery mode and lock databases\n"));
 
@@ -2655,9 +2658,11 @@ static void main_loop(struct ctdb_context *ctdb, struct ctdb_recoverd *rec,
 		return;
 	}
 
-	/* Check if an IP takeover run is needed and trigger one if
-	 * necessary */
-	verify_local_ip_allocation(ctdb, rec, pnn, nodemap);
+	if (ctdb->recovery_mode == CTDB_RECOVERY_NORMAL) {
+		/* Check if an IP takeover run is needed and trigger one if
+		 * necessary */
+		verify_local_ip_allocation(ctdb, rec, pnn, nodemap);
+	}
 
 	/* if we are not the recmaster then we do not need to check
 	   if recovery is needed
diff --git a/ctdb/server/ctdb_recovery_helper.c b/ctdb/server/ctdb_recovery_helper.c
index d54c290..ba2f0a9 100644
--- a/ctdb/server/ctdb_recovery_helper.c
+++ b/ctdb/server/ctdb_recovery_helper.c
@@ -1647,6 +1647,7 @@ static void recover_db_freeze_done(struct tevent_req *subreq)
 		if (ret2 != 0) {
 			LOG("control FREEZE_DB failed for db %s on node %u,"
 			    " ret=%d\n", state->db_name, pnn, ret2);
+			state->ban_credits[pnn] += 1;
 		} else {
 			LOG("control FREEZE_DB failed for db %s, ret=%d\n",
 			    state->db_name, ret);
diff --git a/source3/smbd/smb2_sesssetup.c b/source3/smbd/smb2_sesssetup.c
index 6a0caac..c4ae185 100644
--- a/source3/smbd/smb2_sesssetup.c
+++ b/source3/smbd/smb2_sesssetup.c
@@ -483,6 +483,7 @@ static NTSTATUS smbd_smb2_auth_generic_return(struct smbXsrv_session *session,
 	global_client_caps |= (CAP_LEVEL_II_OPLOCKS|CAP_STATUS32);
 
 	*out_session_id = session->global->session_wire_id;
+	smb2req->last_session_id = session->global->session_wire_id;
 
 	return NT_STATUS_OK;
 }
diff --git a/source3/smbd/smb2_tcon.c b/source3/smbd/smb2_tcon.c
index 5330fc3..914eb87 100644
--- a/source3/smbd/smb2_tcon.c
+++ b/source3/smbd/smb2_tcon.c
@@ -381,6 +381,8 @@ static NTSTATUS smbd_smb2_tree_connect(struct smbd_smb2_request *req,
 	*out_maximal_access = tcon->compat->share_access;
 
 	*out_tree_id = tcon->global->tcon_wire_id;
+	req->last_tid = tcon->global->tcon_wire_id;
+
 	return NT_STATUS_OK;
 }
 
diff --git a/source3/winbindd/winbindd_cm.c b/source3/winbindd/winbindd_cm.c
index d1dce73..a656d88 100644
--- a/source3/winbindd/winbindd_cm.c
+++ b/source3/winbindd/winbindd_cm.c
@@ -2979,10 +2979,12 @@ static NTSTATUS cm_connect_lsa_tcp(struct winbindd_domain *domain,
 
 	conn = &domain->conn;
 
-	if (conn->lsa_pipe_tcp &&
+	/*
+	 * rpccli_is_connected handles more error cases
+	 */
+	if (rpccli_is_connected(conn->lsa_pipe_tcp) &&
 	    conn->lsa_pipe_tcp->transport->transport == NCACN_IP_TCP &&
-	    conn->lsa_pipe_tcp->auth->auth_level >= DCERPC_AUTH_LEVEL_INTEGRITY &&
-	    rpccli_is_connected(conn->lsa_pipe_tcp)) {
+	    conn->lsa_pipe_tcp->auth->auth_level >= DCERPC_AUTH_LEVEL_INTEGRITY) {
 		goto done;
 	}
 


-- 
Samba Shared Repository



More information about the samba-cvs mailing list