Skip to contentSkip to conversation

python: use force=2 as default

PATCH New Alexander Aring 1 participant 4 messages Aug 15, 2022

lore
Share & tools
lore
#0 lore raw

PATCH 1/4 python: use force=2 as default

To avoid -EBUSY cases we should use 2 as default for force when releasing the lockspace.

---
 python/bindings/dlm.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
python/bindings/dlm.py +1 -1
index b77d374c..b592a3e4 100644
@@ -129,7 +129,7 @@ class Lockspace:
 		if not self.__ls:
 			raise DLMError(-errno.ENOMEM)
 
-	def release(self, force=0):
+	def release(self, force=2):
 		if not self.__ls:
 			return
 
Signature · 1 line
2.31.1
#1 lore raw

PATCH 2/4 libdlm: force timeout parameter to zero

This patch forces to disable the timeout parameter for libdlm users as this feature is now deprecated and we will just unset it even if the user sets it to a value.

---
 libdlm/libdlm.c | 2 --
 1 file changed, 2 deletions(-)
libdlm/libdlm.c +0 -2
index ebfba457..fbdf9a09 100644
@@ -807,8 +807,6 @@ static int ls_lock_v6(dlm_lshandle_t ls,
 
 	if (xid)
 		req->i.lock.xid = *xid;
-	if (timeout)
-		req->i.lock.timeout = *timeout;
 
 	if (flags & LKF_CONVERT) {
 		req->i.lock.namelen = 0;
Signature · 1 line
2.31.1
#2 lore raw

PATCH 3/4 libdlm: force unset the DLM_LSFL_TIMEWARN flag

In reply to Alexander Aring

This patch forces to disable the DLM_LSFL_TIMEWARN flag for libdlm users as this feature is now deprecated and we will just unset it even if the user sets it.

---
 libdlm/libdlm.c | 1 +
 1 file changed, 1 insertion(+)
libdlm/libdlm.c +1 -0
index fbdf9a09..c5e78616 100644
@@ -1344,6 +1344,7 @@ static dlm_lshandle_t create_lockspace(const char *name, mode_t mode,
 
 dlm_lshandle_t dlm_new_lockspace(const char *name, mode_t mode, uint32_t flags)
 {
+	flags &= ~DLM_LSFL_TIMEWARN;
 	return create_lockspace(name, mode, flags);
 }
 
Signature · 1 line
2.31.1
#3 lore raw

PATCH 4/4 controld: remove timewarn handling

In reply to Alexander Aring

The netlink implementation is actually not build and the timewarn setting in controld would only activate some debugging warning if some lock requests got stucked without any other notification mechanism e.g. netlink. We remove this handling now because the dlm kernel implementation deprecates this feature.

---
 dlm_controld/action.c             |   4 -
 dlm_controld/dlm_daemon.h         |   1 -
 dlm_controld/main.c               |   5 -
 dlm_controld/netlink.c            | 232 ------------------------------
 dlm_tool/dlm_tool.8               |   3 +-
 libdlm/man/dlm_create_lockspace.3 |   6 +-
 6 files changed, 2 insertions(+), 249 deletions(-)
 delete mode 100644 dlm_controld/netlink.c
dlm_controld/action.c +0 -4
index baddaf81..67aa6896 100644
@@ -882,10 +882,6 @@ int setup_configfs_options(void)
 	    dlm_options[log_debug_ind].file_set)
 		set_configfs_cluster("log_debug", NULL, opt(log_debug_ind));
 
-	if (dlm_options[timewarn_ind].cli_set ||
-	    dlm_options[timewarn_ind].file_set)
-		set_configfs_cluster("timewarn_cs", NULL, opt(timewarn_ind));
-
 	if (dlm_options[port_ind].cli_set ||
 	    dlm_options[port_ind].file_set)
 		set_configfs_cluster("tcp_port", NULL, optu(port_ind));
dlm_controld/dlm_daemon.h +0 -1
index 22e286fc..b829e0de 100644
@@ -102,7 +102,6 @@ enum {
         daemon_debug_ind = 0,
         foreground_ind,
         log_debug_ind,
-        timewarn_ind,
         protocol_ind,
         port_ind,
         debug_logfile_ind,
dlm_controld/main.c +0 -5
index a98dae56..80fe14bd 100644
@@ -1796,11 +1796,6 @@ static void set_opt_defaults(void)
 			0, NULL, 0, 1,
 			"enable kernel dlm debugging messages");
 
-	set_opt_default(timewarn_ind,
-			"timewarn", '\0', req_arg_int,
-			0, NULL, 0, 0,
-			""); /* do not advertise */
-
 	set_opt_default(protocol_ind,
 			"protocol", 'r', req_arg_str,
 			-1, "detect", 0, 0,
dlm_controld/netlink.c deleted +0 -232

232 lines not on this page · raw message

dlm_tool/dlm_tool.8 +1 -2
index 2a14fe02..7c670ddb 100644
@@ -198,12 +198,11 @@ $ dlm_tool dump_config | head -n 5
 daemon_debug=1 (set_config)
 foreground=0
 log_debug=1 (dlm.conf)
-timewarn=0
 protocol=detect
 .fi
 
 In this case, daemon_debug is set by set_config, log_debug is set from
-dlm.conf, foreground, timewarn and protocol are using default values.
+dlm.conf, foreground and protocol are using default values.
 
 .SS set_config
 
libdlm/man/dlm_create_lockspace.3 +1 -5
index 93ffc54e..aa6f5aed 100644
@@ -43,11 +43,7 @@ int dlm_new_lockspace(const char *name, mode_t mode, uint32_t flags)
 .PP
 Performs the same function as 
 .B dlm_create_lockspace()
-above, but passes some creation flags to the call that affect the lockspace being created. Currently supported flags are:
-.nf
-DLM_LSFL_TIMEWARN the dlm should emit warnings over netlink when locks
-                  have been waiting too long; required for deadlock
-                  detection
+above, but passes some creation flags to the call that affect the lockspace being created.
 .fi
 .SS
 int dlm_release_lockspace(const char *name, dlm_lshandle_t ls, int force)
Signature · 1 line
2.31.1