* [Cluster-devel] [PATCH dlm/next 0/5] fs: dlm: prepare for deprecate DLM API
@ 2022-06-17 20:00 Alexander Aring
2022-06-17 20:00 ` [Cluster-devel] [PATCH dlm/next 1/5] fs: dlm: add comment about lkb IFL flags Alexander Aring
` (4 more replies)
0 siblings, 5 replies; 8+ messages in thread
From: Alexander Aring @ 2022-06-17 20:00 UTC (permalink / raw)
To: cluster-devel.redhat.com
Hi,
This patch series deprecates some dlm API which will be removed in later
Linux kernel releases (aim v5.22). Distribution should switch to
CONFIG_DLM_DEPRECATED_API to N. Upcoming patches for libdlm will
disable to use any of the deprecated API even if user sets it.
The reason to deprecate some API is that it's either not useful anymore
or it makes probably some problems if it's getting used.
It's a little bit an ifdef-hell right now but it marks certain areas which
will be removed in v5.22 (except the additional changes in the UAPI
header).
- Alex
Alexander Aring (5):
fs: dlm: add comment about lkb IFL flags
fs: dlm: remove warn waiter handling
fs: dlm: remove timeout from dlm_user_adopt_orphan
fs: dlm: add API deprecation warning
fs: dlm: don't use deprecated API by default
fs/dlm/Kconfig | 9 +++
fs/dlm/Makefile | 2 +-
fs/dlm/config.c | 21 ++++---
fs/dlm/config.h | 3 +-
fs/dlm/dlm_internal.h | 27 ++++++++-
fs/dlm/lock.c | 131 ++++++++++++++++--------------------------
fs/dlm/lock.h | 9 ++-
fs/dlm/lockspace.c | 22 ++++++-
fs/dlm/netlink.c | 8 +++
fs/dlm/user.c | 21 ++++++-
10 files changed, 156 insertions(+), 97 deletions(-)
--
2.31.1
^ permalink raw reply [flat|nested] 8+ messages in thread
* [Cluster-devel] [PATCH dlm/next 1/5] fs: dlm: add comment about lkb IFL flags
2022-06-17 20:00 [Cluster-devel] [PATCH dlm/next 0/5] fs: dlm: prepare for deprecate DLM API Alexander Aring
@ 2022-06-17 20:00 ` Alexander Aring
2022-06-17 22:28 ` Alexander Aring
2022-06-17 20:00 ` [Cluster-devel] [PATCH dlm/next 2/5] fs: dlm: remove warn waiter handling Alexander Aring
` (3 subsequent siblings)
4 siblings, 1 reply; 8+ messages in thread
From: Alexander Aring @ 2022-06-17 20:00 UTC (permalink / raw)
To: cluster-devel.redhat.com
This patch adds comments about the difference between the lower 2 bytes
of lkb flags and the 2 upper bytes of the lkb IFL flags. In short the
upper 2 bytes will be handled as internal flags whereas the lower 2
bytes are part of the DLM protocol and are used to exchange messages.
Signed-off-by: Alexander Aring <aahringo@redhat.com>
---
fs/dlm/dlm_internal.h | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/fs/dlm/dlm_internal.h b/fs/dlm/dlm_internal.h
index c03388a3875c..151f98fc3f22 100644
--- a/fs/dlm/dlm_internal.h
+++ b/fs/dlm/dlm_internal.h
@@ -207,6 +207,13 @@ struct dlm_args {
#define DLM_IFL_TIMEOUT_CANCEL 0x00800000
#define DLM_IFL_DEADLOCK_CANCEL 0x01000000
#define DLM_IFL_STUB_MS 0x02000000 /* magic number for m_flags */
+/* least significant 2 bytes are message changed, they are full transmitted
+ * but at receive side only the 2 bytes LSB will be set.
+ *
+ * Even wireshark dlm dissector does only evaluate the lower bytes and note
+ * that they may not be used on transceiver side, we assume the higher bytes
+ * are for internal use or reserved so long they are parsed on receiver side.
+ */
#define DLM_IFL_USER 0x00000001
#define DLM_IFL_ORPHAN 0x00000002
--
2.31.1
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [Cluster-devel] [PATCH dlm/next 2/5] fs: dlm: remove warn waiter handling
2022-06-17 20:00 [Cluster-devel] [PATCH dlm/next 0/5] fs: dlm: prepare for deprecate DLM API Alexander Aring
2022-06-17 20:00 ` [Cluster-devel] [PATCH dlm/next 1/5] fs: dlm: add comment about lkb IFL flags Alexander Aring
@ 2022-06-17 20:00 ` Alexander Aring
2022-06-17 22:29 ` Alexander Aring
2022-06-17 20:00 ` [Cluster-devel] [PATCH dlm/next 3/5] fs: dlm: remove timeout from dlm_user_adopt_orphan Alexander Aring
` (2 subsequent siblings)
4 siblings, 1 reply; 8+ messages in thread
From: Alexander Aring @ 2022-06-17 20:00 UTC (permalink / raw)
To: cluster-devel.redhat.com
This patch removes a feature in DLM to warn about if we don't get an
answer back if we send a DLM message out and we wait for a reply
message. There are in my opinion two reasons to add such warning, first
is to know there might be a communication error and a message drop due
communication errors. Second the other side dropped the message on stack
because some reason.
However the first reason the midcomms layer will notify us if a message
was received otherwise midcomms debugfs can tell us if there are still
pending messages around.
For the second reason we can check the other nodes debug messages to see
if there was a drop on application layer. However I think the initial
idea of this feature was to check for the first reason.
This patch also removes the configfs entry waitwarn_us which is not
being set by official dlm user space software, we assume fail to setting
this configfs entry will not end in an critical error.
Signed-off-by: Alexander Aring <aahringo@redhat.com>
---
fs/dlm/config.c | 7 ----
fs/dlm/config.h | 1 -
fs/dlm/dlm_internal.h | 1 -
fs/dlm/lock.c | 80 -------------------------------------------
fs/dlm/lockspace.c | 1 -
5 files changed, 90 deletions(-)
diff --git a/fs/dlm/config.c b/fs/dlm/config.c
index 42eee2783756..081fd201e3a8 100644
--- a/fs/dlm/config.c
+++ b/fs/dlm/config.c
@@ -76,7 +76,6 @@ struct dlm_cluster {
unsigned int cl_protocol;
unsigned int cl_mark;
unsigned int cl_timewarn_cs;
- unsigned int cl_waitwarn_us;
unsigned int cl_new_rsb_count;
unsigned int cl_recover_callbacks;
char cl_cluster_name[DLM_LOCKSPACE_LEN];
@@ -103,7 +102,6 @@ enum {
CLUSTER_ATTR_PROTOCOL,
CLUSTER_ATTR_MARK,
CLUSTER_ATTR_TIMEWARN_CS,
- CLUSTER_ATTR_WAITWARN_US,
CLUSTER_ATTR_NEW_RSB_COUNT,
CLUSTER_ATTR_RECOVER_CALLBACKS,
CLUSTER_ATTR_CLUSTER_NAME,
@@ -225,7 +223,6 @@ CLUSTER_ATTR(log_info, NULL);
CLUSTER_ATTR(protocol, dlm_check_protocol_and_dlm_running);
CLUSTER_ATTR(mark, NULL);
CLUSTER_ATTR(timewarn_cs, dlm_check_zero);
-CLUSTER_ATTR(waitwarn_us, NULL);
CLUSTER_ATTR(new_rsb_count, NULL);
CLUSTER_ATTR(recover_callbacks, NULL);
@@ -241,7 +238,6 @@ static struct configfs_attribute *cluster_attrs[] = {
[CLUSTER_ATTR_PROTOCOL] = &cluster_attr_protocol,
[CLUSTER_ATTR_MARK] = &cluster_attr_mark,
[CLUSTER_ATTR_TIMEWARN_CS] = &cluster_attr_timewarn_cs,
- [CLUSTER_ATTR_WAITWARN_US] = &cluster_attr_waitwarn_us,
[CLUSTER_ATTR_NEW_RSB_COUNT] = &cluster_attr_new_rsb_count,
[CLUSTER_ATTR_RECOVER_CALLBACKS] = &cluster_attr_recover_callbacks,
[CLUSTER_ATTR_CLUSTER_NAME] = &cluster_attr_cluster_name,
@@ -433,7 +429,6 @@ static struct config_group *make_cluster(struct config_group *g,
cl->cl_log_info = dlm_config.ci_log_info;
cl->cl_protocol = dlm_config.ci_protocol;
cl->cl_timewarn_cs = dlm_config.ci_timewarn_cs;
- cl->cl_waitwarn_us = dlm_config.ci_waitwarn_us;
cl->cl_new_rsb_count = dlm_config.ci_new_rsb_count;
cl->cl_recover_callbacks = dlm_config.ci_recover_callbacks;
memcpy(cl->cl_cluster_name, dlm_config.ci_cluster_name,
@@ -955,7 +950,6 @@ int dlm_our_addr(struct sockaddr_storage *addr, int num)
#define DEFAULT_PROTOCOL DLM_PROTO_TCP
#define DEFAULT_MARK 0
#define DEFAULT_TIMEWARN_CS 500 /* 5 sec = 500 centiseconds */
-#define DEFAULT_WAITWARN_US 0
#define DEFAULT_NEW_RSB_COUNT 128
#define DEFAULT_RECOVER_CALLBACKS 0
#define DEFAULT_CLUSTER_NAME ""
@@ -972,7 +966,6 @@ struct dlm_config_info dlm_config = {
.ci_protocol = DEFAULT_PROTOCOL,
.ci_mark = DEFAULT_MARK,
.ci_timewarn_cs = DEFAULT_TIMEWARN_CS,
- .ci_waitwarn_us = DEFAULT_WAITWARN_US,
.ci_new_rsb_count = DEFAULT_NEW_RSB_COUNT,
.ci_recover_callbacks = DEFAULT_RECOVER_CALLBACKS,
.ci_cluster_name = DEFAULT_CLUSTER_NAME
diff --git a/fs/dlm/config.h b/fs/dlm/config.h
index df92b0a07fc6..cb23d018e863 100644
--- a/fs/dlm/config.h
+++ b/fs/dlm/config.h
@@ -38,7 +38,6 @@ struct dlm_config_info {
int ci_protocol;
int ci_mark;
int ci_timewarn_cs;
- int ci_waitwarn_us;
int ci_new_rsb_count;
int ci_recover_callbacks;
char ci_cluster_name[DLM_LOCKSPACE_LEN];
diff --git a/fs/dlm/dlm_internal.h b/fs/dlm/dlm_internal.h
index 151f98fc3f22..19136b7374a1 100644
--- a/fs/dlm/dlm_internal.h
+++ b/fs/dlm/dlm_internal.h
@@ -258,7 +258,6 @@ struct dlm_lkb {
struct list_head lkb_ownqueue; /* list of locks for a process */
struct list_head lkb_time_list;
ktime_t lkb_timestamp;
- ktime_t lkb_wait_time;
unsigned long lkb_timeout_cs;
struct mutex lkb_cb_mutex;
diff --git a/fs/dlm/lock.c b/fs/dlm/lock.c
index e80d42ba64ae..080cd216a9a4 100644
--- a/fs/dlm/lock.c
+++ b/fs/dlm/lock.c
@@ -1402,75 +1402,6 @@ static int msg_reply_type(int mstype)
return -1;
}
-static int nodeid_warned(int nodeid, int num_nodes, int *warned)
-{
- int i;
-
- for (i = 0; i < num_nodes; i++) {
- if (!warned[i]) {
- warned[i] = nodeid;
- return 0;
- }
- if (warned[i] == nodeid)
- return 1;
- }
- return 0;
-}
-
-void dlm_scan_waiters(struct dlm_ls *ls)
-{
- struct dlm_lkb *lkb;
- s64 us;
- s64 debug_maxus = 0;
- u32 debug_scanned = 0;
- u32 debug_expired = 0;
- int num_nodes = 0;
- int *warned = NULL;
-
- if (!dlm_config.ci_waitwarn_us)
- return;
-
- mutex_lock(&ls->ls_waiters_mutex);
-
- list_for_each_entry(lkb, &ls->ls_waiters, lkb_wait_reply) {
- if (!lkb->lkb_wait_time)
- continue;
-
- debug_scanned++;
-
- us = ktime_to_us(ktime_sub(ktime_get(), lkb->lkb_wait_time));
-
- if (us < dlm_config.ci_waitwarn_us)
- continue;
-
- lkb->lkb_wait_time = 0;
-
- debug_expired++;
- if (us > debug_maxus)
- debug_maxus = us;
-
- if (!num_nodes) {
- num_nodes = ls->ls_num_nodes;
- warned = kcalloc(num_nodes, sizeof(int), GFP_KERNEL);
- }
- if (!warned)
- continue;
- if (nodeid_warned(lkb->lkb_wait_nodeid, num_nodes, warned))
- continue;
-
- log_error(ls, "waitwarn %x %lld %d us check connection to "
- "node %d", lkb->lkb_id, (long long)us,
- dlm_config.ci_waitwarn_us, lkb->lkb_wait_nodeid);
- }
- mutex_unlock(&ls->ls_waiters_mutex);
- kfree(warned);
-
- if (debug_expired)
- log_debug(ls, "scan_waiters %u warn %u over %d us max %lld us",
- debug_scanned, debug_expired,
- dlm_config.ci_waitwarn_us, (long long)debug_maxus);
-}
-
/* add/remove lkb from global waiters list of lkb's waiting for
a reply from a remote node */
@@ -1514,7 +1445,6 @@ static int add_to_waiters(struct dlm_lkb *lkb, int mstype, int to_nodeid)
lkb->lkb_wait_count++;
lkb->lkb_wait_type = mstype;
- lkb->lkb_wait_time = ktime_get();
lkb->lkb_wait_nodeid = to_nodeid; /* for debugging */
hold_lkb(lkb);
list_add(&lkb->lkb_wait_reply, &ls->ls_waiters);
@@ -1962,16 +1892,6 @@ void dlm_adjust_timeouts(struct dlm_ls *ls)
list_for_each_entry(lkb, &ls->ls_timeout, lkb_time_list)
lkb->lkb_timestamp = ktime_add_us(lkb->lkb_timestamp, adj_us);
mutex_unlock(&ls->ls_timeout_mutex);
-
- if (!dlm_config.ci_waitwarn_us)
- return;
-
- mutex_lock(&ls->ls_waiters_mutex);
- list_for_each_entry(lkb, &ls->ls_waiters, lkb_wait_reply) {
- if (ktime_to_us(lkb->lkb_wait_time))
- lkb->lkb_wait_time = ktime_get();
- }
- mutex_unlock(&ls->ls_waiters_mutex);
}
/* lkb is master or local copy */
diff --git a/fs/dlm/lockspace.c b/fs/dlm/lockspace.c
index a4f492189a08..f9cbf35b3db1 100644
--- a/fs/dlm/lockspace.c
+++ b/fs/dlm/lockspace.c
@@ -275,7 +275,6 @@ static int dlm_scand(void *data)
ls->ls_scan_time = jiffies;
dlm_scan_rsbs(ls);
dlm_scan_timeout(ls);
- dlm_scan_waiters(ls);
dlm_unlock_recovery(ls);
} else {
ls->ls_scan_time += HZ;
--
2.31.1
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [Cluster-devel] [PATCH dlm/next 3/5] fs: dlm: remove timeout from dlm_user_adopt_orphan
2022-06-17 20:00 [Cluster-devel] [PATCH dlm/next 0/5] fs: dlm: prepare for deprecate DLM API Alexander Aring
2022-06-17 20:00 ` [Cluster-devel] [PATCH dlm/next 1/5] fs: dlm: add comment about lkb IFL flags Alexander Aring
2022-06-17 20:00 ` [Cluster-devel] [PATCH dlm/next 2/5] fs: dlm: remove warn waiter handling Alexander Aring
@ 2022-06-17 20:00 ` Alexander Aring
2022-06-17 20:00 ` [Cluster-devel] [PATCH dlm/next 4/5] fs: dlm: add API deprecation warning Alexander Aring
2022-06-17 20:00 ` [Cluster-devel] [PATCH dlm/next 5/5] fs: dlm: don't use deprecated API by default Alexander Aring
4 siblings, 0 replies; 8+ messages in thread
From: Alexander Aring @ 2022-06-17 20:00 UTC (permalink / raw)
To: cluster-devel.redhat.com
This patch removes the timeout parameter from dlm_user_adopt_orphan(),
it's never been used.
Signed-off-by: Alexander Aring <aahringo@redhat.com>
---
fs/dlm/lock.c | 2 +-
fs/dlm/lock.h | 2 +-
fs/dlm/user.c | 1 -
3 files changed, 2 insertions(+), 3 deletions(-)
diff --git a/fs/dlm/lock.c b/fs/dlm/lock.c
index 080cd216a9a4..12d4cc742308 100644
--- a/fs/dlm/lock.c
+++ b/fs/dlm/lock.c
@@ -5886,7 +5886,7 @@ int dlm_user_convert(struct dlm_ls *ls, struct dlm_user_args *ua_tmp,
int dlm_user_adopt_orphan(struct dlm_ls *ls, struct dlm_user_args *ua_tmp,
int mode, uint32_t flags, void *name, unsigned int namelen,
- unsigned long timeout_cs, uint32_t *lkid)
+ uint32_t *lkid)
{
struct dlm_lkb *lkb = NULL, *iter;
struct dlm_user_args *ua;
diff --git a/fs/dlm/lock.h b/fs/dlm/lock.h
index 252a5898f908..59089bb7c532 100644
--- a/fs/dlm/lock.h
+++ b/fs/dlm/lock.h
@@ -49,7 +49,7 @@ int dlm_user_convert(struct dlm_ls *ls, struct dlm_user_args *ua_tmp,
unsigned long timeout_cs);
int dlm_user_adopt_orphan(struct dlm_ls *ls, struct dlm_user_args *ua_tmp,
int mode, uint32_t flags, void *name, unsigned int namelen,
- unsigned long timeout_cs, uint32_t *lkid);
+ uint32_t *lkid);
int dlm_user_unlock(struct dlm_ls *ls, struct dlm_user_args *ua_tmp,
uint32_t flags, uint32_t lkid, char *lvb_in);
int dlm_user_cancel(struct dlm_ls *ls, struct dlm_user_args *ua_tmp,
diff --git a/fs/dlm/user.c b/fs/dlm/user.c
index 1060b24f18d4..4b2a24a6a15d 100644
--- a/fs/dlm/user.c
+++ b/fs/dlm/user.c
@@ -270,7 +270,6 @@ static int device_user_lock(struct dlm_user_proc *proc,
error = dlm_user_adopt_orphan(ls, ua,
params->mode, params->flags,
params->name, params->namelen,
- (unsigned long) params->timeout,
&lkid);
if (!error)
error = lkid;
--
2.31.1
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [Cluster-devel] [PATCH dlm/next 4/5] fs: dlm: add API deprecation warning
2022-06-17 20:00 [Cluster-devel] [PATCH dlm/next 0/5] fs: dlm: prepare for deprecate DLM API Alexander Aring
` (2 preceding siblings ...)
2022-06-17 20:00 ` [Cluster-devel] [PATCH dlm/next 3/5] fs: dlm: remove timeout from dlm_user_adopt_orphan Alexander Aring
@ 2022-06-17 20:00 ` Alexander Aring
2022-06-17 20:00 ` [Cluster-devel] [PATCH dlm/next 5/5] fs: dlm: don't use deprecated API by default Alexander Aring
4 siblings, 0 replies; 8+ messages in thread
From: Alexander Aring @ 2022-06-17 20:00 UTC (permalink / raw)
To: cluster-devel.redhat.com
This patch adds a deprecation config to DLM for API which will be removed
in kernel v5.22. This deprecation warning will occur if somebody enables
the deprecation API Kconfig entry and using the actual feature which
will get deprecated as a notification to update their user space.
Note that the timeout feature for kernel locks was never been supported.
Signed-off-by: Alexander Aring <aahringo@redhat.com>
---
fs/dlm/Kconfig | 9 +++++++++
fs/dlm/lockspace.c | 11 ++++++++++-
fs/dlm/netlink.c | 8 ++++++++
fs/dlm/user.c | 8 ++++++++
4 files changed, 35 insertions(+), 1 deletion(-)
diff --git a/fs/dlm/Kconfig b/fs/dlm/Kconfig
index ee92634196a8..cae58f21da08 100644
--- a/fs/dlm/Kconfig
+++ b/fs/dlm/Kconfig
@@ -9,6 +9,15 @@ menuconfig DLM
A general purpose distributed lock manager for kernel or userspace
applications.
+config DLM_DEPRECATED_API
+ bool "DLM deprecated API"
+ depends on DLM
+ help
+ Enables DLM deprecated API which will be removed in later Linux
+ kernel releases.
+
+ If you are unsure, say N.
+
config DLM_DEBUG
bool "DLM debugging"
depends on DLM
diff --git a/fs/dlm/lockspace.c b/fs/dlm/lockspace.c
index f9cbf35b3db1..ac227a30141c 100644
--- a/fs/dlm/lockspace.c
+++ b/fs/dlm/lockspace.c
@@ -489,8 +489,17 @@ static int new_lockspace(const char *name, const char *cluster,
ls->ls_ops_arg = ops_arg;
}
- if (flags & DLM_LSFL_TIMEWARN)
+ if (flags & DLM_LSFL_TIMEWARN) {
+#ifdef CONFIG_DLM_DEPRECATED_API
+ pr_warn_once("===============================================================\n"
+ "WARNING: the dlm DLM_LSFL_TIMEWARN flag is being deprecated and\n"
+ " will be removed in v5.22!\n"
+ " Inclusive DLM_LSFL_TIMEWARN define in UAPI header!\n"
+ "===============================================================\n");
+#endif
+
set_bit(LSFL_TIMEWARN, &ls->ls_flags);
+ }
/* ls_exflags are forced to match among nodes, and we don't
need to require all nodes to have some flags set */
diff --git a/fs/dlm/netlink.c b/fs/dlm/netlink.c
index 67f68d48d60c..fed04860e550 100644
--- a/fs/dlm/netlink.c
+++ b/fs/dlm/netlink.c
@@ -57,6 +57,14 @@ static int send_data(struct sk_buff *skb)
static int user_cmd(struct sk_buff *skb, struct genl_info *info)
{
+#ifdef CONFIG_DLM_DEPRECATED_API
+ pr_warn_once("====================================================\n"
+ "WARNING: the dlm netlink API is being deprecated and\n"
+ " will be removed in v5.22!\n"
+ " Inclusive DLM netlink UAPI header!\n"
+ "====================================================\n");
+#endif
+
listener_nlportid = info->snd_portid;
printk("user_cmd nlpid %u\n", listener_nlportid);
return 0;
diff --git a/fs/dlm/user.c b/fs/dlm/user.c
index 4b2a24a6a15d..1fccb08bd825 100644
--- a/fs/dlm/user.c
+++ b/fs/dlm/user.c
@@ -250,6 +250,14 @@ static int device_user_lock(struct dlm_user_proc *proc,
goto out;
}
+#ifdef CONFIG_DLM_DEPRECATED_API
+ if (params->timeout)
+ pr_warn_once("========================================================\n"
+ "WARNING: the lkb timeout feature is being deprecated and\n"
+ " will be removed in v5.22!\n"
+ "========================================================\n");
+#endif
+
ua = kzalloc(sizeof(struct dlm_user_args), GFP_NOFS);
if (!ua)
goto out;
--
2.31.1
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [Cluster-devel] [PATCH dlm/next 5/5] fs: dlm: don't use deprecated API by default
2022-06-17 20:00 [Cluster-devel] [PATCH dlm/next 0/5] fs: dlm: prepare for deprecate DLM API Alexander Aring
` (3 preceding siblings ...)
2022-06-17 20:00 ` [Cluster-devel] [PATCH dlm/next 4/5] fs: dlm: add API deprecation warning Alexander Aring
@ 2022-06-17 20:00 ` Alexander Aring
4 siblings, 0 replies; 8+ messages in thread
From: Alexander Aring @ 2022-06-17 20:00 UTC (permalink / raw)
To: cluster-devel.redhat.com
This patch will disable the usage of current deprecated API if
CONFIG_DLM_DEPRECATED_API is not set. This API will be removed in
upcoming kernel release v5.22. I marked some places with a ifdef around
deprecated API, at other places I used a no-op function replacement,
depending on the situation how it's used and what was simpler to
implement.
This patch disables the configfs entry timewarn_cs which will be set by
official dlm user space software but does not end in a critical error.
We assume it should be save to remove it.
Signed-off-by: Alexander Aring <aahringo@redhat.com>
---
fs/dlm/Makefile | 2 +-
fs/dlm/config.c | 14 +++++++++++++
fs/dlm/config.h | 2 ++
fs/dlm/dlm_internal.h | 19 ++++++++++++++++-
fs/dlm/lock.c | 49 +++++++++++++++++++++++++++++++++++++++++++
fs/dlm/lock.h | 7 +++++++
fs/dlm/lockspace.c | 14 ++++++++++---
fs/dlm/user.c | 12 +++++++++++
8 files changed, 114 insertions(+), 5 deletions(-)
diff --git a/fs/dlm/Makefile b/fs/dlm/Makefile
index 3545fdafc6fb..71dab733cf9a 100644
--- a/fs/dlm/Makefile
+++ b/fs/dlm/Makefile
@@ -9,7 +9,6 @@ dlm-y := ast.o \
member.o \
memory.o \
midcomms.o \
- netlink.o \
lowcomms.o \
plock.o \
rcom.o \
@@ -18,5 +17,6 @@ dlm-y := ast.o \
requestqueue.o \
user.o \
util.o
+dlm-$(CONFIG_DLM_DEPRECATED_API) += netlink.o
dlm-$(CONFIG_DLM_DEBUG) += debug_fs.o
diff --git a/fs/dlm/config.c b/fs/dlm/config.c
index 081fd201e3a8..ac8b62106ce0 100644
--- a/fs/dlm/config.c
+++ b/fs/dlm/config.c
@@ -75,7 +75,9 @@ struct dlm_cluster {
unsigned int cl_log_info;
unsigned int cl_protocol;
unsigned int cl_mark;
+#ifdef CONFIG_DLM_DEPRECATED_API
unsigned int cl_timewarn_cs;
+#endif
unsigned int cl_new_rsb_count;
unsigned int cl_recover_callbacks;
char cl_cluster_name[DLM_LOCKSPACE_LEN];
@@ -101,7 +103,9 @@ enum {
CLUSTER_ATTR_LOG_INFO,
CLUSTER_ATTR_PROTOCOL,
CLUSTER_ATTR_MARK,
+#ifdef CONFIG_DLM_DEPRECATED_API
CLUSTER_ATTR_TIMEWARN_CS,
+#endif
CLUSTER_ATTR_NEW_RSB_COUNT,
CLUSTER_ATTR_RECOVER_CALLBACKS,
CLUSTER_ATTR_CLUSTER_NAME,
@@ -222,7 +226,9 @@ CLUSTER_ATTR(log_debug, NULL);
CLUSTER_ATTR(log_info, NULL);
CLUSTER_ATTR(protocol, dlm_check_protocol_and_dlm_running);
CLUSTER_ATTR(mark, NULL);
+#ifdef CONFIG_DLM_DEPRECATED_API
CLUSTER_ATTR(timewarn_cs, dlm_check_zero);
+#endif
CLUSTER_ATTR(new_rsb_count, NULL);
CLUSTER_ATTR(recover_callbacks, NULL);
@@ -237,7 +243,9 @@ static struct configfs_attribute *cluster_attrs[] = {
[CLUSTER_ATTR_LOG_INFO] = &cluster_attr_log_info,
[CLUSTER_ATTR_PROTOCOL] = &cluster_attr_protocol,
[CLUSTER_ATTR_MARK] = &cluster_attr_mark,
+#ifdef CONFIG_DLM_DEPRECATED_API
[CLUSTER_ATTR_TIMEWARN_CS] = &cluster_attr_timewarn_cs,
+#endif
[CLUSTER_ATTR_NEW_RSB_COUNT] = &cluster_attr_new_rsb_count,
[CLUSTER_ATTR_RECOVER_CALLBACKS] = &cluster_attr_recover_callbacks,
[CLUSTER_ATTR_CLUSTER_NAME] = &cluster_attr_cluster_name,
@@ -428,7 +436,9 @@ static struct config_group *make_cluster(struct config_group *g,
cl->cl_log_debug = dlm_config.ci_log_debug;
cl->cl_log_info = dlm_config.ci_log_info;
cl->cl_protocol = dlm_config.ci_protocol;
+#ifdef CONFIG_DLM_DEPRECATED_API
cl->cl_timewarn_cs = dlm_config.ci_timewarn_cs;
+#endif
cl->cl_new_rsb_count = dlm_config.ci_new_rsb_count;
cl->cl_recover_callbacks = dlm_config.ci_recover_callbacks;
memcpy(cl->cl_cluster_name, dlm_config.ci_cluster_name,
@@ -949,7 +959,9 @@ int dlm_our_addr(struct sockaddr_storage *addr, int num)
#define DEFAULT_LOG_INFO 1
#define DEFAULT_PROTOCOL DLM_PROTO_TCP
#define DEFAULT_MARK 0
+#ifdef CONFIG_DLM_DEPRECATED_API
#define DEFAULT_TIMEWARN_CS 500 /* 5 sec = 500 centiseconds */
+#endif
#define DEFAULT_NEW_RSB_COUNT 128
#define DEFAULT_RECOVER_CALLBACKS 0
#define DEFAULT_CLUSTER_NAME ""
@@ -965,7 +977,9 @@ struct dlm_config_info dlm_config = {
.ci_log_info = DEFAULT_LOG_INFO,
.ci_protocol = DEFAULT_PROTOCOL,
.ci_mark = DEFAULT_MARK,
+#ifdef CONFIG_DLM_DEPRECATED_API
.ci_timewarn_cs = DEFAULT_TIMEWARN_CS,
+#endif
.ci_new_rsb_count = DEFAULT_NEW_RSB_COUNT,
.ci_recover_callbacks = DEFAULT_RECOVER_CALLBACKS,
.ci_cluster_name = DEFAULT_CLUSTER_NAME
diff --git a/fs/dlm/config.h b/fs/dlm/config.h
index cb23d018e863..55c5f2c13ebd 100644
--- a/fs/dlm/config.h
+++ b/fs/dlm/config.h
@@ -37,7 +37,9 @@ struct dlm_config_info {
int ci_log_info;
int ci_protocol;
int ci_mark;
+#ifdef CONFIG_DLM_DEPRECATED_API
int ci_timewarn_cs;
+#endif
int ci_new_rsb_count;
int ci_recover_callbacks;
char ci_cluster_name[DLM_LOCKSPACE_LEN];
diff --git a/fs/dlm/dlm_internal.h b/fs/dlm/dlm_internal.h
index 19136b7374a1..f65b9a0e3718 100644
--- a/fs/dlm/dlm_internal.h
+++ b/fs/dlm/dlm_internal.h
@@ -145,7 +145,9 @@ struct dlm_args {
void (*bastfn) (void *astparam, int mode);
int mode;
struct dlm_lksb *lksb;
+#ifdef CONFIG_DLM_DEPRECATED_API
unsigned long timeout;
+#endif
};
@@ -203,8 +205,10 @@ struct dlm_args {
#define DLM_IFL_OVERLAP_UNLOCK 0x00080000
#define DLM_IFL_OVERLAP_CANCEL 0x00100000
#define DLM_IFL_ENDOFLIFE 0x00200000
+#ifdef CONFIG_DLM_DEPRECATED_API
#define DLM_IFL_WATCH_TIMEWARN 0x00400000
#define DLM_IFL_TIMEOUT_CANCEL 0x00800000
+#endif
#define DLM_IFL_DEADLOCK_CANCEL 0x01000000
#define DLM_IFL_STUB_MS 0x02000000 /* magic number for m_flags */
/* least significant 2 bytes are message changed, they are full transmitted
@@ -256,9 +260,12 @@ struct dlm_lkb {
struct list_head lkb_rsb_lookup; /* waiting for rsb lookup */
struct list_head lkb_wait_reply; /* waiting for remote reply */
struct list_head lkb_ownqueue; /* list of locks for a process */
- struct list_head lkb_time_list;
ktime_t lkb_timestamp;
+
+#ifdef CONFIG_DLM_DEPRECATED_API
+ struct list_head lkb_time_list;
unsigned long lkb_timeout_cs;
+#endif
struct mutex lkb_cb_mutex;
struct work_struct lkb_cb_work;
@@ -574,8 +581,10 @@ struct dlm_ls {
struct mutex ls_orphans_mutex;
struct list_head ls_orphans;
+#ifdef CONFIG_DLM_DEPRECATED_API
struct mutex ls_timeout_mutex;
struct list_head ls_timeout;
+#endif
spinlock_t ls_new_rsb_spin;
int ls_new_rsb_count;
@@ -694,7 +703,9 @@ struct dlm_ls {
#define LSFL_RCOM_READY 5
#define LSFL_RCOM_WAIT 6
#define LSFL_UEVENT_WAIT 7
+#ifdef CONFIG_DLM_DEPRECATED_API
#define LSFL_TIMEWARN 8
+#endif
#define LSFL_CB_DELAY 9
#define LSFL_NODIR 10
@@ -747,9 +758,15 @@ static inline int dlm_no_directory(struct dlm_ls *ls)
return test_bit(LSFL_NODIR, &ls->ls_flags);
}
+#ifdef CONFIG_DLM_DEPRECATED_API
int dlm_netlink_init(void);
void dlm_netlink_exit(void);
void dlm_timeout_warn(struct dlm_lkb *lkb);
+#else
+static inline int dlm_netlink_init(void) { return 0; }
+static inline void dlm_netlink_exit(void) { };
+static inline void dlm_timeout_warn(struct dlm_lkb *lkb) { };
+#endif
int dlm_plock_init(void);
void dlm_plock_exit(void);
diff --git a/fs/dlm/lock.c b/fs/dlm/lock.c
index 12d4cc742308..bac57f95b8c9 100644
--- a/fs/dlm/lock.c
+++ b/fs/dlm/lock.c
@@ -296,12 +296,14 @@ static void queue_cast(struct dlm_rsb *r, struct dlm_lkb *lkb, int rv)
DLM_ASSERT(lkb->lkb_lksb, dlm_print_lkb(lkb););
+#ifdef CONFIG_DLM_DEPRECATED_API
/* if the operation was a cancel, then return -DLM_ECANCEL, if a
timeout caused the cancel then return -ETIMEDOUT */
if (rv == -DLM_ECANCEL && (lkb->lkb_flags & DLM_IFL_TIMEOUT_CANCEL)) {
lkb->lkb_flags &= ~DLM_IFL_TIMEOUT_CANCEL;
rv = -ETIMEDOUT;
}
+#endif
if (rv == -DLM_ECANCEL && (lkb->lkb_flags & DLM_IFL_DEADLOCK_CANCEL)) {
lkb->lkb_flags &= ~DLM_IFL_DEADLOCK_CANCEL;
@@ -1210,7 +1212,9 @@ static int _create_lkb(struct dlm_ls *ls, struct dlm_lkb **lkb_ret,
kref_init(&lkb->lkb_ref);
INIT_LIST_HEAD(&lkb->lkb_ownqueue);
INIT_LIST_HEAD(&lkb->lkb_rsb_lookup);
+#ifdef CONFIG_DLM_DEPRECATED_API
INIT_LIST_HEAD(&lkb->lkb_time_list);
+#endif
INIT_LIST_HEAD(&lkb->lkb_cb_list);
mutex_init(&lkb->lkb_cb_mutex);
INIT_WORK(&lkb->lkb_cb_work, dlm_callback_work);
@@ -1772,6 +1776,7 @@ void dlm_scan_rsbs(struct dlm_ls *ls)
}
}
+#ifdef CONFIG_DLM_DEPRECATED_API
static void add_timeout(struct dlm_lkb *lkb)
{
struct dlm_ls *ls = lkb->lkb_resource->res_ls;
@@ -1893,6 +1898,13 @@ void dlm_adjust_timeouts(struct dlm_ls *ls)
lkb->lkb_timestamp = ktime_add_us(lkb->lkb_timestamp, adj_us);
mutex_unlock(&ls->ls_timeout_mutex);
}
+#else
+static void add_timeout(struct dlm_lkb *lkb) { }
+static void del_timeout(struct dlm_lkb *lkb) { }
+void dlm_scan_timeout(struct dlm_ls *ls) { }
+void dlm_adjust_timeouts(struct dlm_ls *ls) { }
+#endif
+
/* lkb is master or local copy */
@@ -2757,12 +2769,20 @@ static void confirm_master(struct dlm_rsb *r, int error)
}
}
+#ifdef CONFIG_DLM_DEPRECATED_API
static int set_lock_args(int mode, struct dlm_lksb *lksb, uint32_t flags,
int namelen, unsigned long timeout_cs,
void (*ast) (void *astparam),
void *astparam,
void (*bast) (void *astparam, int mode),
struct dlm_args *args)
+#else
+static int set_lock_args(int mode, struct dlm_lksb *lksb, uint32_t flags,
+ int namelen, void (*ast)(void *astparam),
+ void *astparam,
+ void (*bast)(void *astparam, int mode),
+ struct dlm_args *args)
+#endif
{
int rv = -EINVAL;
@@ -2815,7 +2835,9 @@ static int set_lock_args(int mode, struct dlm_lksb *lksb, uint32_t flags,
args->astfn = ast;
args->astparam = astparam;
args->bastfn = bast;
+#ifdef CONFIG_DLM_DEPRECATED_API
args->timeout = timeout_cs;
+#endif
args->mode = mode;
args->lksb = lksb;
rv = 0;
@@ -2871,7 +2893,9 @@ static int validate_lock_args(struct dlm_ls *ls, struct dlm_lkb *lkb,
lkb->lkb_lksb = args->lksb;
lkb->lkb_lvbptr = args->lksb->sb_lvbptr;
lkb->lkb_ownpid = (int) current->pid;
+#ifdef CONFIG_DLM_DEPRECATED_API
lkb->lkb_timeout_cs = args->timeout;
+#endif
rv = 0;
out:
if (rv)
@@ -3394,8 +3418,13 @@ int dlm_lock(dlm_lockspace_t *lockspace,
trace_dlm_lock_start(ls, lkb, name, namelen, mode, flags);
+#ifdef CONFIG_DLM_DEPRECATED_API
error = set_lock_args(mode, lksb, flags, namelen, 0, ast,
astarg, bast, &args);
+#else
+ error = set_lock_args(mode, lksb, flags, namelen, ast, astarg, bast,
+ &args);
+#endif
if (error)
goto out_put;
@@ -5759,9 +5788,14 @@ int dlm_recover_process_copy(struct dlm_ls *ls, struct dlm_rcom *rc)
return 0;
}
+#ifdef CONFIG_DLM_DEPRECATED_API
int dlm_user_request(struct dlm_ls *ls, struct dlm_user_args *ua,
int mode, uint32_t flags, void *name, unsigned int namelen,
unsigned long timeout_cs)
+#else
+int dlm_user_request(struct dlm_ls *ls, struct dlm_user_args *ua,
+ int mode, uint32_t flags, void *name, unsigned int namelen)
+#endif
{
struct dlm_lkb *lkb;
struct dlm_args args;
@@ -5784,8 +5818,13 @@ int dlm_user_request(struct dlm_ls *ls, struct dlm_user_args *ua,
goto out;
}
}
+#ifdef CONFIG_DLM_DEPRECATED_API
error = set_lock_args(mode, &ua->lksb, flags, namelen, timeout_cs,
fake_astfn, ua, fake_bastfn, &args);
+#else
+ error = set_lock_args(mode, &ua->lksb, flags, namelen, fake_astfn, ua,
+ fake_bastfn, &args);
+#endif
if (error) {
kfree(ua->lksb.sb_lvbptr);
ua->lksb.sb_lvbptr = NULL;
@@ -5824,9 +5863,14 @@ int dlm_user_request(struct dlm_ls *ls, struct dlm_user_args *ua,
return error;
}
+#ifdef CONFIG_DLM_DEPRECATED_API
int dlm_user_convert(struct dlm_ls *ls, struct dlm_user_args *ua_tmp,
int mode, uint32_t flags, uint32_t lkid, char *lvb_in,
unsigned long timeout_cs)
+#else
+int dlm_user_convert(struct dlm_ls *ls, struct dlm_user_args *ua_tmp,
+ int mode, uint32_t flags, uint32_t lkid, char *lvb_in)
+#endif
{
struct dlm_lkb *lkb;
struct dlm_args args;
@@ -5861,8 +5905,13 @@ int dlm_user_convert(struct dlm_ls *ls, struct dlm_user_args *ua_tmp,
ua->bastaddr = ua_tmp->bastaddr;
ua->user_lksb = ua_tmp->user_lksb;
+#ifdef CONFIG_DLM_DEPRECATED_API
error = set_lock_args(mode, &ua->lksb, flags, 0, timeout_cs,
fake_astfn, ua, fake_bastfn, &args);
+#else
+ error = set_lock_args(mode, &ua->lksb, flags, 0, fake_astfn, ua,
+ fake_bastfn, &args);
+#endif
if (error)
goto out_put;
diff --git a/fs/dlm/lock.h b/fs/dlm/lock.h
index 59089bb7c532..3f121b0a5115 100644
--- a/fs/dlm/lock.h
+++ b/fs/dlm/lock.h
@@ -41,12 +41,19 @@ void dlm_recover_waiters_pre(struct dlm_ls *ls);
int dlm_recover_master_copy(struct dlm_ls *ls, struct dlm_rcom *rc);
int dlm_recover_process_copy(struct dlm_ls *ls, struct dlm_rcom *rc);
+#ifdef CONFIG_DLM_DEPRECATED_API
int dlm_user_request(struct dlm_ls *ls, struct dlm_user_args *ua, int mode,
uint32_t flags, void *name, unsigned int namelen,
unsigned long timeout_cs);
int dlm_user_convert(struct dlm_ls *ls, struct dlm_user_args *ua_tmp,
int mode, uint32_t flags, uint32_t lkid, char *lvb_in,
unsigned long timeout_cs);
+#else
+int dlm_user_request(struct dlm_ls *ls, struct dlm_user_args *ua, int mode,
+ uint32_t flags, void *name, unsigned int namelen);
+int dlm_user_convert(struct dlm_ls *ls, struct dlm_user_args *ua_tmp,
+ int mode, uint32_t flags, uint32_t lkid, char *lvb_in);
+#endif
int dlm_user_adopt_orphan(struct dlm_ls *ls, struct dlm_user_args *ua_tmp,
int mode, uint32_t flags, void *name, unsigned int namelen,
uint32_t *lkid);
diff --git a/fs/dlm/lockspace.c b/fs/dlm/lockspace.c
index ac227a30141c..3918616c7f2f 100644
--- a/fs/dlm/lockspace.c
+++ b/fs/dlm/lockspace.c
@@ -489,22 +489,28 @@ static int new_lockspace(const char *name, const char *cluster,
ls->ls_ops_arg = ops_arg;
}
- if (flags & DLM_LSFL_TIMEWARN) {
#ifdef CONFIG_DLM_DEPRECATED_API
+ if (flags & DLM_LSFL_TIMEWARN) {
pr_warn_once("===============================================================\n"
"WARNING: the dlm DLM_LSFL_TIMEWARN flag is being deprecated and\n"
" will be removed in v5.22!\n"
" Inclusive DLM_LSFL_TIMEWARN define in UAPI header!\n"
"===============================================================\n");
-#endif
set_bit(LSFL_TIMEWARN, &ls->ls_flags);
}
/* ls_exflags are forced to match among nodes, and we don't
- need to require all nodes to have some flags set */
+ * need to require all nodes to have some flags set
+ */
ls->ls_exflags = (flags & ~(DLM_LSFL_TIMEWARN | DLM_LSFL_FS |
DLM_LSFL_NEWEXCL));
+#else
+ /* ls_exflags are forced to match among nodes, and we don't
+ * need to require all nodes to have some flags set
+ */
+ ls->ls_exflags = (flags & ~(DLM_LSFL_FS | DLM_LSFL_NEWEXCL));
+#endif
size = READ_ONCE(dlm_config.ci_rsbtbl_size);
ls->ls_rsbtbl_size = size;
@@ -535,8 +541,10 @@ static int new_lockspace(const char *name, const char *cluster,
mutex_init(&ls->ls_waiters_mutex);
INIT_LIST_HEAD(&ls->ls_orphans);
mutex_init(&ls->ls_orphans_mutex);
+#ifdef CONFIG_DLM_DEPRECATED_API
INIT_LIST_HEAD(&ls->ls_timeout);
mutex_init(&ls->ls_timeout_mutex);
+#endif
INIT_LIST_HEAD(&ls->ls_new_rsb);
spin_lock_init(&ls->ls_new_rsb_spin);
diff --git a/fs/dlm/user.c b/fs/dlm/user.c
index 1fccb08bd825..999918348b31 100644
--- a/fs/dlm/user.c
+++ b/fs/dlm/user.c
@@ -270,10 +270,16 @@ static int device_user_lock(struct dlm_user_proc *proc,
ua->xid = params->xid;
if (params->flags & DLM_LKF_CONVERT) {
+#ifdef CONFIG_DLM_DEPRECATED_API
error = dlm_user_convert(ls, ua,
params->mode, params->flags,
params->lkid, params->lvb,
(unsigned long) params->timeout);
+#else
+ error = dlm_user_convert(ls, ua,
+ params->mode, params->flags,
+ params->lkid, params->lvb);
+#endif
} else if (params->flags & DLM_LKF_ORPHAN) {
error = dlm_user_adopt_orphan(ls, ua,
params->mode, params->flags,
@@ -282,10 +288,16 @@ static int device_user_lock(struct dlm_user_proc *proc,
if (!error)
error = lkid;
} else {
+#ifdef CONFIG_DLM_DEPRECATED_API
error = dlm_user_request(ls, ua,
params->mode, params->flags,
params->name, params->namelen,
(unsigned long) params->timeout);
+#else
+ error = dlm_user_request(ls, ua,
+ params->mode, params->flags,
+ params->name, params->namelen);
+#endif
if (!error)
error = ua->lksb.sb_lkid;
}
--
2.31.1
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [Cluster-devel] [PATCH dlm/next 1/5] fs: dlm: add comment about lkb IFL flags
2022-06-17 20:00 ` [Cluster-devel] [PATCH dlm/next 1/5] fs: dlm: add comment about lkb IFL flags Alexander Aring
@ 2022-06-17 22:28 ` Alexander Aring
0 siblings, 0 replies; 8+ messages in thread
From: Alexander Aring @ 2022-06-17 22:28 UTC (permalink / raw)
To: cluster-devel.redhat.com
Hi,
On Fri, Jun 17, 2022 at 4:00 PM Alexander Aring <aahringo@redhat.com> wrote:
>
> This patch adds comments about the difference between the lower 2 bytes
> of lkb flags and the 2 upper bytes of the lkb IFL flags. In short the
> upper 2 bytes will be handled as internal flags whereas the lower 2
> bytes are part of the DLM protocol and are used to exchange messages.
>
> Signed-off-by: Alexander Aring <aahringo@redhat.com>
> ---
> fs/dlm/dlm_internal.h | 7 +++++++
> 1 file changed, 7 insertions(+)
>
> diff --git a/fs/dlm/dlm_internal.h b/fs/dlm/dlm_internal.h
> index c03388a3875c..151f98fc3f22 100644
> --- a/fs/dlm/dlm_internal.h
> +++ b/fs/dlm/dlm_internal.h
> @@ -207,6 +207,13 @@ struct dlm_args {
> #define DLM_IFL_TIMEOUT_CANCEL 0x00800000
> #define DLM_IFL_DEADLOCK_CANCEL 0x01000000
> #define DLM_IFL_STUB_MS 0x02000000 /* magic number for m_flags */
> +/* least significant 2 bytes are message changed, they are full transmitted
> + * but at receive side only the 2 bytes LSB will be set.
> + *
> + * Even wireshark dlm dissector does only evaluate the lower bytes and note
> + * that they may not be used on transceiver side, we assume the higher bytes
> + * are for internal use or reserved so long they are parsed on receiver side.
not parsed*
- Alex
^ permalink raw reply [flat|nested] 8+ messages in thread
* [Cluster-devel] [PATCH dlm/next 2/5] fs: dlm: remove warn waiter handling
2022-06-17 20:00 ` [Cluster-devel] [PATCH dlm/next 2/5] fs: dlm: remove warn waiter handling Alexander Aring
@ 2022-06-17 22:29 ` Alexander Aring
0 siblings, 0 replies; 8+ messages in thread
From: Alexander Aring @ 2022-06-17 22:29 UTC (permalink / raw)
To: cluster-devel.redhat.com
Hi,
On Fri, Jun 17, 2022 at 4:00 PM Alexander Aring <aahringo@redhat.com> wrote:
>
> This patch removes a feature in DLM to warn about if we don't get an
> answer back if we send a DLM message out and we wait for a reply
> message. There are in my opinion two reasons to add such warning, first
> is to know there might be a communication error and a message drop due
> communication errors. Second the other side dropped the message on stack
> because some reason.
>
> However the first reason the midcomms layer will notify us if a message
> was received otherwise midcomms debugfs can tell us if there are still
> pending messages around.
>
> For the second reason we can check the other nodes debug messages to see
> if there was a drop on application layer. However I think the initial
> idea of this feature was to check for the first reason.
>
> This patch also removes the configfs entry waitwarn_us which is not
> being set by official dlm user space software, we assume fail to setting
> this configfs entry will not end in an critical error.
>
> Signed-off-by: Alexander Aring <aahringo@redhat.com>
> ---
> fs/dlm/config.c | 7 ----
> fs/dlm/config.h | 1 -
> fs/dlm/dlm_internal.h | 1 -
> fs/dlm/lock.c | 80 -------------------------------------------
> fs/dlm/lockspace.c | 1 -
> 5 files changed, 90 deletions(-)
>
> diff --git a/fs/dlm/config.c b/fs/dlm/config.c
> index 42eee2783756..081fd201e3a8 100644
> --- a/fs/dlm/config.c
> +++ b/fs/dlm/config.c
> @@ -76,7 +76,6 @@ struct dlm_cluster {
> unsigned int cl_protocol;
> unsigned int cl_mark;
> unsigned int cl_timewarn_cs;
> - unsigned int cl_waitwarn_us;
> unsigned int cl_new_rsb_count;
> unsigned int cl_recover_callbacks;
> char cl_cluster_name[DLM_LOCKSPACE_LEN];
> @@ -103,7 +102,6 @@ enum {
> CLUSTER_ATTR_PROTOCOL,
> CLUSTER_ATTR_MARK,
> CLUSTER_ATTR_TIMEWARN_CS,
> - CLUSTER_ATTR_WAITWARN_US,
> CLUSTER_ATTR_NEW_RSB_COUNT,
> CLUSTER_ATTR_RECOVER_CALLBACKS,
> CLUSTER_ATTR_CLUSTER_NAME,
> @@ -225,7 +223,6 @@ CLUSTER_ATTR(log_info, NULL);
> CLUSTER_ATTR(protocol, dlm_check_protocol_and_dlm_running);
> CLUSTER_ATTR(mark, NULL);
> CLUSTER_ATTR(timewarn_cs, dlm_check_zero);
> -CLUSTER_ATTR(waitwarn_us, NULL);
> CLUSTER_ATTR(new_rsb_count, NULL);
> CLUSTER_ATTR(recover_callbacks, NULL);
>
> @@ -241,7 +238,6 @@ static struct configfs_attribute *cluster_attrs[] = {
> [CLUSTER_ATTR_PROTOCOL] = &cluster_attr_protocol,
> [CLUSTER_ATTR_MARK] = &cluster_attr_mark,
> [CLUSTER_ATTR_TIMEWARN_CS] = &cluster_attr_timewarn_cs,
> - [CLUSTER_ATTR_WAITWARN_US] = &cluster_attr_waitwarn_us,
> [CLUSTER_ATTR_NEW_RSB_COUNT] = &cluster_attr_new_rsb_count,
> [CLUSTER_ATTR_RECOVER_CALLBACKS] = &cluster_attr_recover_callbacks,
> [CLUSTER_ATTR_CLUSTER_NAME] = &cluster_attr_cluster_name,
> @@ -433,7 +429,6 @@ static struct config_group *make_cluster(struct config_group *g,
> cl->cl_log_info = dlm_config.ci_log_info;
> cl->cl_protocol = dlm_config.ci_protocol;
> cl->cl_timewarn_cs = dlm_config.ci_timewarn_cs;
> - cl->cl_waitwarn_us = dlm_config.ci_waitwarn_us;
> cl->cl_new_rsb_count = dlm_config.ci_new_rsb_count;
> cl->cl_recover_callbacks = dlm_config.ci_recover_callbacks;
> memcpy(cl->cl_cluster_name, dlm_config.ci_cluster_name,
> @@ -955,7 +950,6 @@ int dlm_our_addr(struct sockaddr_storage *addr, int num)
> #define DEFAULT_PROTOCOL DLM_PROTO_TCP
> #define DEFAULT_MARK 0
> #define DEFAULT_TIMEWARN_CS 500 /* 5 sec = 500 centiseconds */
> -#define DEFAULT_WAITWARN_US 0
> #define DEFAULT_NEW_RSB_COUNT 128
> #define DEFAULT_RECOVER_CALLBACKS 0
> #define DEFAULT_CLUSTER_NAME ""
> @@ -972,7 +966,6 @@ struct dlm_config_info dlm_config = {
> .ci_protocol = DEFAULT_PROTOCOL,
> .ci_mark = DEFAULT_MARK,
> .ci_timewarn_cs = DEFAULT_TIMEWARN_CS,
> - .ci_waitwarn_us = DEFAULT_WAITWARN_US,
> .ci_new_rsb_count = DEFAULT_NEW_RSB_COUNT,
> .ci_recover_callbacks = DEFAULT_RECOVER_CALLBACKS,
> .ci_cluster_name = DEFAULT_CLUSTER_NAME
> diff --git a/fs/dlm/config.h b/fs/dlm/config.h
> index df92b0a07fc6..cb23d018e863 100644
> --- a/fs/dlm/config.h
> +++ b/fs/dlm/config.h
> @@ -38,7 +38,6 @@ struct dlm_config_info {
> int ci_protocol;
> int ci_mark;
> int ci_timewarn_cs;
> - int ci_waitwarn_us;
> int ci_new_rsb_count;
> int ci_recover_callbacks;
> char ci_cluster_name[DLM_LOCKSPACE_LEN];
> diff --git a/fs/dlm/dlm_internal.h b/fs/dlm/dlm_internal.h
> index 151f98fc3f22..19136b7374a1 100644
> --- a/fs/dlm/dlm_internal.h
> +++ b/fs/dlm/dlm_internal.h
> @@ -258,7 +258,6 @@ struct dlm_lkb {
> struct list_head lkb_ownqueue; /* list of locks for a process */
> struct list_head lkb_time_list;
> ktime_t lkb_timestamp;
> - ktime_t lkb_wait_time;
> unsigned long lkb_timeout_cs;
>
> struct mutex lkb_cb_mutex;
> diff --git a/fs/dlm/lock.c b/fs/dlm/lock.c
> index e80d42ba64ae..080cd216a9a4 100644
> --- a/fs/dlm/lock.c
> +++ b/fs/dlm/lock.c
> @@ -1402,75 +1402,6 @@ static int msg_reply_type(int mstype)
> return -1;
> }
>
> -static int nodeid_warned(int nodeid, int num_nodes, int *warned)
> -{
> - int i;
> -
> - for (i = 0; i < num_nodes; i++) {
> - if (!warned[i]) {
> - warned[i] = nodeid;
> - return 0;
> - }
> - if (warned[i] == nodeid)
> - return 1;
> - }
> - return 0;
> -}
> -
> -void dlm_scan_waiters(struct dlm_ls *ls)
> -{
there is probably a prototype which I need to remove as well... and I
need to check the other patches...
- Alex
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2022-06-17 22:29 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-06-17 20:00 [Cluster-devel] [PATCH dlm/next 0/5] fs: dlm: prepare for deprecate DLM API Alexander Aring
2022-06-17 20:00 ` [Cluster-devel] [PATCH dlm/next 1/5] fs: dlm: add comment about lkb IFL flags Alexander Aring
2022-06-17 22:28 ` Alexander Aring
2022-06-17 20:00 ` [Cluster-devel] [PATCH dlm/next 2/5] fs: dlm: remove warn waiter handling Alexander Aring
2022-06-17 22:29 ` Alexander Aring
2022-06-17 20:00 ` [Cluster-devel] [PATCH dlm/next 3/5] fs: dlm: remove timeout from dlm_user_adopt_orphan Alexander Aring
2022-06-17 20:00 ` [Cluster-devel] [PATCH dlm/next 4/5] fs: dlm: add API deprecation warning Alexander Aring
2022-06-17 20:00 ` [Cluster-devel] [PATCH dlm/next 5/5] fs: dlm: don't use deprecated API by default 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).