cluster-devel.redhat.com archive mirror
 help / color / mirror / Atom feed
* [Cluster-devel] [PATCH dlm-tool 0/3] dlm_controld: changes from v2 to v3
@ 2020-07-09 18:59 Alexander Aring
  2020-07-09 18:59 ` [Cluster-devel] [PATCH dlm-tool 1/3] dlm_controld: don't abort node configuration Alexander Aring
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Alexander Aring @ 2020-07-09 18:59 UTC (permalink / raw)
  To: cluster-devel.redhat.com

Hi,

series v2 got applied and my changes for series v3 got dropped. I
created this patch series now to sync upstream with the previous v3
series. Every change is now splitted in a separate patch.

Thank you.

- Alex

Alexander Aring (3):
  dlm_controld: don't abort node configuration
  dlm_controld: change enable_waitplock_recovery default
  dlm_controld: add default value handling for unsigned int

 dlm_controld/action.c     |  7 ++++-
 dlm_controld/dlm_daemon.h |  1 +
 dlm_controld/main.c       | 61 +++++++++++++++++++++------------------
 3 files changed, 40 insertions(+), 29 deletions(-)

-- 
2.26.2



^ permalink raw reply	[flat|nested] 4+ messages in thread

* [Cluster-devel] [PATCH dlm-tool 1/3] dlm_controld: don't abort node configuration
  2020-07-09 18:59 [Cluster-devel] [PATCH dlm-tool 0/3] dlm_controld: changes from v2 to v3 Alexander Aring
@ 2020-07-09 18:59 ` Alexander Aring
  2020-07-09 19:00 ` [Cluster-devel] [PATCH dlm-tool 2/3] dlm_controld: change enable_waitplock_recovery default Alexander Aring
  2020-07-09 19:00 ` [Cluster-devel] [PATCH dlm-tool 3/3] dlm_controld: add default value handling for unsigned int Alexander Aring
  2 siblings, 0 replies; 4+ messages in thread
From: Alexander Aring @ 2020-07-09 18:59 UTC (permalink / raw)
  To: cluster-devel.redhat.com

In case of not having mark value file we don't abort the whole
configuration if any error on open fails. We skip this specific setting
and jump to the next one since it's not mandatory to have a correct mark
setting. It will still appear inside the logs.
---
 dlm_controld/action.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/dlm_controld/action.c b/dlm_controld/action.c
index 63040227..bc9c44f2 100644
--- a/dlm_controld/action.c
+++ b/dlm_controld/action.c
@@ -642,6 +642,9 @@ int add_configfs_node(int nodeid, char *addr, int addrlen, int local,
 
 	/*
 	 * set skb mark for nodeid
+	 *
+	 * If open() fails we skip it because kernel doesn't support it.
+	 * It's not a required confiuration. It will show up in the log.
 	 */
 
 	memset(path, 0, PATH_MAX);
@@ -650,7 +653,7 @@ int add_configfs_node(int nodeid, char *addr, int addrlen, int local,
 	fd = open(path, O_WRONLY);
 	if (fd < 0) {
 		log_error("%s: open failed: %d", path, errno);
-		return -1;
+		goto skip_non_required;
 	}
 
 	memset(buf, 0, sizeof(buf));
@@ -664,6 +667,8 @@ int add_configfs_node(int nodeid, char *addr, int addrlen, int local,
 	}
 	close(fd);
 
+skip_non_required:
+
 	/*
 	 * set local
 	 */
-- 
2.26.2



^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [Cluster-devel] [PATCH dlm-tool 2/3] dlm_controld: change enable_waitplock_recovery default
  2020-07-09 18:59 [Cluster-devel] [PATCH dlm-tool 0/3] dlm_controld: changes from v2 to v3 Alexander Aring
  2020-07-09 18:59 ` [Cluster-devel] [PATCH dlm-tool 1/3] dlm_controld: don't abort node configuration Alexander Aring
@ 2020-07-09 19:00 ` Alexander Aring
  2020-07-09 19:00 ` [Cluster-devel] [PATCH dlm-tool 3/3] dlm_controld: add default value handling for unsigned int Alexander Aring
  2 siblings, 0 replies; 4+ messages in thread
From: Alexander Aring @ 2020-07-09 19:00 UTC (permalink / raw)
  To: cluster-devel.redhat.com

This patch sets the default value of enable_waitplock_recovery to false
as it is the same as the kernel configuration default. Note that in this
specific case dlm_controld will not set the default value on startup.
However this patch syncs the kernel and user land default behaviour.
---
 dlm_controld/main.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/dlm_controld/main.c b/dlm_controld/main.c
index 3ec318c2..95107d09 100644
--- a/dlm_controld/main.c
+++ b/dlm_controld/main.c
@@ -1754,7 +1754,7 @@ static void set_opt_defaults(void)
 
 	set_opt_default(enable_waitplock_recovery_ind,
 			"enable_waitplock_recovery", '\0', req_arg_bool,
-			1, NULL,
+			0, NULL,
 			"enable/disable posix lock to wait for dlm recovery after lock acquire");
 
 	set_opt_default(plock_debug_ind,
-- 
2.26.2



^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [Cluster-devel] [PATCH dlm-tool 3/3] dlm_controld: add default value handling for unsigned int
  2020-07-09 18:59 [Cluster-devel] [PATCH dlm-tool 0/3] dlm_controld: changes from v2 to v3 Alexander Aring
  2020-07-09 18:59 ` [Cluster-devel] [PATCH dlm-tool 1/3] dlm_controld: don't abort node configuration Alexander Aring
  2020-07-09 19:00 ` [Cluster-devel] [PATCH dlm-tool 2/3] dlm_controld: change enable_waitplock_recovery default Alexander Aring
@ 2020-07-09 19:00 ` Alexander Aring
  2 siblings, 0 replies; 4+ messages in thread
From: Alexander Aring @ 2020-07-09 19:00 UTC (permalink / raw)
  To: cluster-devel.redhat.com

This patch adds suppot to handle default values for unsigned int.
---
 dlm_controld/dlm_daemon.h |  1 +
 dlm_controld/main.c       | 61 +++++++++++++++++++++------------------
 2 files changed, 34 insertions(+), 28 deletions(-)

diff --git a/dlm_controld/dlm_daemon.h b/dlm_controld/dlm_daemon.h
index 979aab7a..ee21c256 100644
--- a/dlm_controld/dlm_daemon.h
+++ b/dlm_controld/dlm_daemon.h
@@ -134,6 +134,7 @@ struct dlm_option {
 
 	int default_int;
 	const char *default_str;
+	unsigned int default_uint;
 
 	int cli_set;
 	int cli_int;
diff --git a/dlm_controld/main.c b/dlm_controld/main.c
index 95107d09..8023f4b0 100644
--- a/dlm_controld/main.c
+++ b/dlm_controld/main.c
@@ -1678,6 +1678,8 @@ static void print_usage(void)
 			printf(" [%d]\n", o->default_int);
 		else if (o->req_arg == req_arg_bool)
 			printf(" [%d]\n", o->default_int);
+		else if (o->req_arg == req_arg_uint)
+			printf(" [%u]\n", o->default_uint);
 		else if (o->req_arg == no_arg && !o->default_int)
 			printf(" [0]\n");
 		else
@@ -1688,7 +1690,8 @@ static void print_usage(void)
 }
 
 static void set_opt_default(int ind, const char *name, char letter, int arg_type,
-			    int default_int, const char *default_str, const char *desc)
+			    int default_int, const char *default_str,
+			    unsigned int default_uint, const char *desc)
 {
 	dlm_options[ind].name = name;
 	dlm_options[ind].letter = letter;
@@ -1696,145 +1699,147 @@ static void set_opt_default(int ind, const char *name, char letter, int arg_type
 	dlm_options[ind].desc = desc;
 	dlm_options[ind].default_int = default_int;
 	dlm_options[ind].default_str = default_str;
+	dlm_options[ind].default_uint = default_uint;
 	dlm_options[ind].use_int = default_int;
 	dlm_options[ind].use_str = (char *)default_str;
+	dlm_options[ind].use_uint = default_uint;
 }
 
 static void set_opt_defaults(void)
 {
 	set_opt_default(daemon_debug_ind,
 			"daemon_debug", 'D', no_arg,
-			0, NULL,
+			0, NULL, 0,
 			"enable debugging to stderr and don't fork");
 
 	set_opt_default(foreground_ind,
 			"foreground", '\0', no_arg,
-			0, NULL,
+			0, NULL, 0,
 			"don't fork");
 
 	set_opt_default(log_debug_ind,
 			"log_debug", 'K', no_arg,
-			0, NULL,
+			0, NULL, 0,
 			"enable kernel dlm debugging messages");
 
 	set_opt_default(timewarn_ind,
 			"timewarn", '\0', req_arg_int,
-			0, NULL,
+			0, NULL, 0,
 			""); /* do not advertise */
 
 	set_opt_default(protocol_ind,
 			"protocol", 'r', req_arg_str,
-			-1, "detect",
+			-1, "detect", 0,
 			"dlm kernel lowcomms protocol: tcp, sctp, detect");
 
 	set_opt_default(bind_all_ind,
 			"bind_all", '\0', req_arg_int,
-			0, NULL,
+			0, NULL, 0,
 			""); /* do not advertise */
 
 	set_opt_default(mark_ind,
 			"mark", '\0', req_arg_uint,
-			0, NULL,
+			0, NULL, 0,
 			"set mark value for the DLM in-kernel listen socket");
 
 	set_opt_default(debug_logfile_ind,
 			"debug_logfile", 'L', no_arg,
-			0, NULL,
+			0, NULL, 0,
 			"write debugging to log file");
 
 	set_opt_default(enable_fscontrol_ind,
 			"enable_fscontrol", '\0', req_arg_bool,
-			0, NULL,
+			0, NULL, 0,
 			""); /* do not advertise */
 
 	set_opt_default(enable_plock_ind,
 			"enable_plock", 'p', req_arg_bool,
-			1, NULL,
+			1, NULL, 0,
 			"enable/disable posix lock support for cluster fs");
 
 	set_opt_default(enable_waitplock_recovery_ind,
 			"enable_waitplock_recovery", '\0', req_arg_bool,
-			0, NULL,
+			0, NULL, 0,
 			"enable/disable posix lock to wait for dlm recovery after lock acquire");
 
 	set_opt_default(plock_debug_ind,
 			"plock_debug", 'P', no_arg,
-			0, NULL,
+			0, NULL, 0,
 			"enable plock debugging");
 
 	set_opt_default(plock_rate_limit_ind,
 			"plock_rate_limit", 'l', req_arg_int,
-			0, NULL,
+			0, NULL, 0,
 			"limit rate of plock operations (0 for none)");
 
 	set_opt_default(plock_ownership_ind,
 			"plock_ownership", 'o', req_arg_bool,
-			0, NULL,
+			0, NULL, 0,
 			"enable/disable plock ownership");
 
 	set_opt_default(drop_resources_time_ind,
 			"drop_resources_time", 't', req_arg_int,
-			10000, NULL,
+			10000, NULL, 0,
 			"plock ownership drop resources time (milliseconds)");
 
 	set_opt_default(drop_resources_count_ind,
 			"drop_resources_count", 'c', req_arg_int,
-			10, NULL,
+			10, NULL, 0,
 			"plock ownership drop resources count");
 
 	set_opt_default(drop_resources_age_ind,
 			"drop_resources_age", 'a', req_arg_int,
-			10000, NULL,
+			10000, NULL, 0,
 			"plock ownership drop resources age (milliseconds)");
 
 	set_opt_default(post_join_delay_ind,
 			"post_join_delay", 'j', req_arg_int,
-			30, NULL,
+			30, NULL, 0,
 			"seconds to delay fencing after cluster join");
 
 	set_opt_default(enable_fencing_ind,
 			"enable_fencing", 'f', req_arg_bool,
-			1, NULL,
+			1, NULL, 0,
 			"enable/disable fencing");
 
 	set_opt_default(enable_concurrent_fencing_ind,
 			"enable_concurrent_fencing", '\0', req_arg_bool,
-			0, NULL,
+			0, NULL, 0,
 			"enable/disable concurrent fencing");
 
 	set_opt_default(enable_startup_fencing_ind,
 			"enable_startup_fencing", 's', req_arg_bool,
-			1, NULL,
+			1, NULL, 0,
 			"enable/disable startup fencing");
 
 	set_opt_default(repeat_failed_fencing_ind,
 			"repeat_failed_fencing", '\0', req_arg_bool,
-			1, NULL,
+			1, NULL, 0,
 			"enable/disable retrying after fencing fails");
 
 	set_opt_default(enable_quorum_fencing_ind,
 			"enable_quorum_fencing", 'q', req_arg_bool,
-			1, NULL,
+			1, NULL, 0,
 			"enable/disable quorum requirement for fencing");
 
 	set_opt_default(enable_quorum_lockspace_ind,
 			"enable_quorum_lockspace", '\0', req_arg_bool,
-			1, NULL,
+			1, NULL, 0,
 			"enable/disable quorum requirement for lockspace operations");
 
 	set_opt_default(enable_helper_ind,
 			"enable_helper", '\0', req_arg_bool,
-			1, NULL,
+			1, NULL, 0,
 			"enable/disable helper process for running commands");
 
 	set_opt_default(help_ind,
 			"help", 'h', no_arg,
-			-1, NULL,
+			-1, NULL, 0,
 			"print this help, then exit");
 
 	set_opt_default(version_ind,
 			"version", 'V', no_arg,
-			-1, NULL,
+			-1, NULL, 0,
 			"Print program version information, then exit");
 }
 
-- 
2.26.2



^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2020-07-09 19:00 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-07-09 18:59 [Cluster-devel] [PATCH dlm-tool 0/3] dlm_controld: changes from v2 to v3 Alexander Aring
2020-07-09 18:59 ` [Cluster-devel] [PATCH dlm-tool 1/3] dlm_controld: don't abort node configuration Alexander Aring
2020-07-09 19:00 ` [Cluster-devel] [PATCH dlm-tool 2/3] dlm_controld: change enable_waitplock_recovery default Alexander Aring
2020-07-09 19:00 ` [Cluster-devel] [PATCH dlm-tool 3/3] dlm_controld: add default value handling for unsigned int Alexander Aring

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).