Skip to content

Commit fbfaf03

Browse files
committed
Merge tag 'dlm-6.4' of git://git.kernel.org/pub/scm/linux/kernel/git/teigland/linux-dlm
Pull dlm updates from David Teigland: - Remove some unused features (related to lock timeouts) that have been previously scheduled for removal - Fix a bug where the pending callback flag would be incorrectly cleared, which could potentially result in missing a completion callback - Use an unbound workqueue for dlm socket handling so that socket operations can be processed with less delay - Fix possible lockspace join connection errors with large clusters (e.g. over 16 nodes) caused by a small socket backlog setting - Use atomic bit ops for internal flags to help avoid mistakes copying flag values from messages - Fix recently introduced bug where memory for lvb data could be unnecessarily allocated for a lock * tag 'dlm-6.4' of git://git.kernel.org/pub/scm/linux/kernel/git/teigland/linux-dlm: fs: dlm: stop unnecessarily filling zero ms_extra bytes fs: dlm: switch lkb_sbflags to atomic ops fs: dlm: rsb hash table flag value to atomic ops fs: dlm: move internal flags to atomic ops fs: dlm: change dflags to use atomic bits fs: dlm: store lkb distributed flags into own value fs: dlm: remove DLM_IFL_LOCAL_MS flag fs: dlm: rename stub to local message flag fs: dlm: remove deprecated code parts DLM: increase socket backlog to avoid hangs with 16 nodes fs: dlm: add unbound flag to dlm_io workqueue fs: dlm: fix DLM_IFL_CB_PENDING gets overwritten
2 parents e0fcc9c + 7a40f1f commit fbfaf03

File tree

23 files changed

+299
-764
lines changed

23 files changed

+299
-764
lines changed

fs/dlm/Kconfig

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,6 @@ menuconfig DLM
88
A general purpose distributed lock manager for kernel or userspace
99
applications.
1010

11-
config DLM_DEPRECATED_API
12-
bool "DLM deprecated API"
13-
depends on DLM
14-
help
15-
Enables deprecated DLM timeout features that will be removed in
16-
later Linux kernel releases.
17-
18-
If you are unsure, say N.
19-
2011
config DLM_DEBUG
2112
bool "DLM debugging"
2213
depends on DLM

fs/dlm/Makefile

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,5 @@ dlm-y := ast.o \
1717
requestqueue.o \
1818
user.o \
1919
util.o
20-
dlm-$(CONFIG_DLM_DEPRECATED_API) += netlink.o
2120
dlm-$(CONFIG_DLM_DEBUG) += debug_fs.o
2221

fs/dlm/ast.c

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ void dlm_purge_lkb_callbacks(struct dlm_lkb *lkb)
4545
kref_put(&cb->ref, dlm_release_callback);
4646
}
4747

48-
lkb->lkb_flags &= ~DLM_IFL_CB_PENDING;
48+
clear_bit(DLM_IFL_CB_PENDING_BIT, &lkb->lkb_iflags);
4949

5050
/* invalidate */
5151
dlm_callback_set_last_ptr(&lkb->lkb_last_cast, NULL);
@@ -103,10 +103,9 @@ int dlm_enqueue_lkb_callback(struct dlm_lkb *lkb, uint32_t flags, int mode,
103103
cb->sb_status = status;
104104
cb->sb_flags = (sbflags & 0x000000FF);
105105
kref_init(&cb->ref);
106-
if (!(lkb->lkb_flags & DLM_IFL_CB_PENDING)) {
107-
lkb->lkb_flags |= DLM_IFL_CB_PENDING;
106+
if (!test_and_set_bit(DLM_IFL_CB_PENDING_BIT, &lkb->lkb_iflags))
108107
rv = DLM_ENQUEUE_CALLBACK_NEED_SCHED;
109-
}
108+
110109
list_add_tail(&cb->list, &lkb->lkb_callbacks);
111110

112111
if (flags & DLM_CB_CAST)
@@ -140,7 +139,7 @@ void dlm_add_cb(struct dlm_lkb *lkb, uint32_t flags, int mode, int status,
140139
struct dlm_ls *ls = lkb->lkb_resource->res_ls;
141140
int rv;
142141

143-
if (lkb->lkb_flags & DLM_IFL_USER) {
142+
if (test_bit(DLM_DFL_USER_BIT, &lkb->lkb_dflags)) {
144143
dlm_user_add_ast(lkb, flags, mode, status, sbflags);
145144
return;
146145
}
@@ -209,7 +208,7 @@ void dlm_callback_work(struct work_struct *work)
209208
spin_lock(&lkb->lkb_cb_lock);
210209
rv = dlm_dequeue_lkb_callback(lkb, &cb);
211210
if (rv == DLM_DEQUEUE_CALLBACK_EMPTY) {
212-
lkb->lkb_flags &= ~DLM_IFL_CB_PENDING;
211+
clear_bit(DLM_IFL_CB_PENDING_BIT, &lkb->lkb_iflags);
213212
spin_unlock(&lkb->lkb_cb_lock);
214213
break;
215214
}

fs/dlm/config.c

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -75,9 +75,6 @@ struct dlm_cluster {
7575
unsigned int cl_log_info;
7676
unsigned int cl_protocol;
7777
unsigned int cl_mark;
78-
#ifdef CONFIG_DLM_DEPRECATED_API
79-
unsigned int cl_timewarn_cs;
80-
#endif
8178
unsigned int cl_new_rsb_count;
8279
unsigned int cl_recover_callbacks;
8380
char cl_cluster_name[DLM_LOCKSPACE_LEN];
@@ -103,9 +100,6 @@ enum {
103100
CLUSTER_ATTR_LOG_INFO,
104101
CLUSTER_ATTR_PROTOCOL,
105102
CLUSTER_ATTR_MARK,
106-
#ifdef CONFIG_DLM_DEPRECATED_API
107-
CLUSTER_ATTR_TIMEWARN_CS,
108-
#endif
109103
CLUSTER_ATTR_NEW_RSB_COUNT,
110104
CLUSTER_ATTR_RECOVER_CALLBACKS,
111105
CLUSTER_ATTR_CLUSTER_NAME,
@@ -226,9 +220,6 @@ CLUSTER_ATTR(log_debug, NULL);
226220
CLUSTER_ATTR(log_info, NULL);
227221
CLUSTER_ATTR(protocol, dlm_check_protocol_and_dlm_running);
228222
CLUSTER_ATTR(mark, NULL);
229-
#ifdef CONFIG_DLM_DEPRECATED_API
230-
CLUSTER_ATTR(timewarn_cs, dlm_check_zero);
231-
#endif
232223
CLUSTER_ATTR(new_rsb_count, NULL);
233224
CLUSTER_ATTR(recover_callbacks, NULL);
234225

@@ -243,9 +234,6 @@ static struct configfs_attribute *cluster_attrs[] = {
243234
[CLUSTER_ATTR_LOG_INFO] = &cluster_attr_log_info,
244235
[CLUSTER_ATTR_PROTOCOL] = &cluster_attr_protocol,
245236
[CLUSTER_ATTR_MARK] = &cluster_attr_mark,
246-
#ifdef CONFIG_DLM_DEPRECATED_API
247-
[CLUSTER_ATTR_TIMEWARN_CS] = &cluster_attr_timewarn_cs,
248-
#endif
249237
[CLUSTER_ATTR_NEW_RSB_COUNT] = &cluster_attr_new_rsb_count,
250238
[CLUSTER_ATTR_RECOVER_CALLBACKS] = &cluster_attr_recover_callbacks,
251239
[CLUSTER_ATTR_CLUSTER_NAME] = &cluster_attr_cluster_name,
@@ -436,9 +424,6 @@ static struct config_group *make_cluster(struct config_group *g,
436424
cl->cl_log_debug = dlm_config.ci_log_debug;
437425
cl->cl_log_info = dlm_config.ci_log_info;
438426
cl->cl_protocol = dlm_config.ci_protocol;
439-
#ifdef CONFIG_DLM_DEPRECATED_API
440-
cl->cl_timewarn_cs = dlm_config.ci_timewarn_cs;
441-
#endif
442427
cl->cl_new_rsb_count = dlm_config.ci_new_rsb_count;
443428
cl->cl_recover_callbacks = dlm_config.ci_recover_callbacks;
444429
memcpy(cl->cl_cluster_name, dlm_config.ci_cluster_name,
@@ -959,9 +944,6 @@ int dlm_our_addr(struct sockaddr_storage *addr, int num)
959944
#define DEFAULT_LOG_INFO 1
960945
#define DEFAULT_PROTOCOL DLM_PROTO_TCP
961946
#define DEFAULT_MARK 0
962-
#ifdef CONFIG_DLM_DEPRECATED_API
963-
#define DEFAULT_TIMEWARN_CS 500 /* 5 sec = 500 centiseconds */
964-
#endif
965947
#define DEFAULT_NEW_RSB_COUNT 128
966948
#define DEFAULT_RECOVER_CALLBACKS 0
967949
#define DEFAULT_CLUSTER_NAME ""
@@ -977,9 +959,6 @@ struct dlm_config_info dlm_config = {
977959
.ci_log_info = DEFAULT_LOG_INFO,
978960
.ci_protocol = DEFAULT_PROTOCOL,
979961
.ci_mark = DEFAULT_MARK,
980-
#ifdef CONFIG_DLM_DEPRECATED_API
981-
.ci_timewarn_cs = DEFAULT_TIMEWARN_CS,
982-
#endif
983962
.ci_new_rsb_count = DEFAULT_NEW_RSB_COUNT,
984963
.ci_recover_callbacks = DEFAULT_RECOVER_CALLBACKS,
985964
.ci_cluster_name = DEFAULT_CLUSTER_NAME

fs/dlm/config.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,6 @@ struct dlm_config_info {
3737
int ci_log_info;
3838
int ci_protocol;
3939
int ci_mark;
40-
#ifdef CONFIG_DLM_DEPRECATED_API
41-
int ci_timewarn_cs;
42-
#endif
4340
int ci_new_rsb_count;
4441
int ci_recover_callbacks;
4542
char ci_cluster_name[DLM_LOCKSPACE_LEN];

fs/dlm/debug_fs.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,7 @@ static void print_format2_lock(struct seq_file *s, struct dlm_lkb *lkb,
170170
u64 xid = 0;
171171
u64 us;
172172

173-
if (lkb->lkb_flags & DLM_IFL_USER) {
173+
if (test_bit(DLM_DFL_USER_BIT, &lkb->lkb_dflags)) {
174174
if (lkb->lkb_ua)
175175
xid = lkb->lkb_ua->xid;
176176
}
@@ -188,7 +188,7 @@ static void print_format2_lock(struct seq_file *s, struct dlm_lkb *lkb,
188188
lkb->lkb_ownpid,
189189
(unsigned long long)xid,
190190
lkb->lkb_exflags,
191-
lkb->lkb_flags,
191+
dlm_iflags_val(lkb),
192192
lkb->lkb_status,
193193
lkb->lkb_grmode,
194194
lkb->lkb_rqmode,
@@ -230,7 +230,7 @@ static void print_format3_lock(struct seq_file *s, struct dlm_lkb *lkb,
230230
{
231231
u64 xid = 0;
232232

233-
if (lkb->lkb_flags & DLM_IFL_USER) {
233+
if (test_bit(DLM_DFL_USER_BIT, &lkb->lkb_dflags)) {
234234
if (lkb->lkb_ua)
235235
xid = lkb->lkb_ua->xid;
236236
}
@@ -242,7 +242,7 @@ static void print_format3_lock(struct seq_file *s, struct dlm_lkb *lkb,
242242
lkb->lkb_ownpid,
243243
(unsigned long long)xid,
244244
lkb->lkb_exflags,
245-
lkb->lkb_flags,
245+
dlm_iflags_val(lkb),
246246
lkb->lkb_status,
247247
lkb->lkb_grmode,
248248
lkb->lkb_rqmode,

0 commit comments

Comments
 (0)