diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2023-04-26 19:36:55 +0300 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2023-04-26 19:36:55 +0300 |
commit | fbfaf03ebac999b4f44f36d851bd729c24c5a658 (patch) | |
tree | 1bf38fc4cfd6a947ed5fddb84d88c241bfd2d303 /fs/dlm/user.c | |
parent | e0fcc9c68d1147ca33159d57332b02ca8bac6ab9 (diff) | |
parent | 7a40f1f18a88c6d43c8725d7f45146480a79fde1 (diff) | |
download | linux-fbfaf03ebac999b4f44f36d851bd729c24c5a658.tar.xz |
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
Diffstat (limited to 'fs/dlm/user.c')
-rw-r--r-- | fs/dlm/user.c | 34 |
1 files changed, 7 insertions, 27 deletions
diff --git a/fs/dlm/user.c b/fs/dlm/user.c index 35129505ddda..d9c09fc0aba1 100644 --- a/fs/dlm/user.c +++ b/fs/dlm/user.c @@ -183,7 +183,8 @@ void dlm_user_add_ast(struct dlm_lkb *lkb, uint32_t flags, int mode, struct dlm_user_proc *proc; int rv; - if (lkb->lkb_flags & (DLM_IFL_ORPHAN | DLM_IFL_DEAD)) + if (test_bit(DLM_DFL_ORPHAN_BIT, &lkb->lkb_dflags) || + test_bit(DLM_IFL_DEAD_BIT, &lkb->lkb_iflags)) return; ls = lkb->lkb_resource->res_ls; @@ -195,7 +196,8 @@ void dlm_user_add_ast(struct dlm_lkb *lkb, uint32_t flags, int mode, for cases where a completion ast is received for an operation that began before clear_proc_locks did its cancel/unlock. */ - if (lkb->lkb_flags & (DLM_IFL_ORPHAN | DLM_IFL_DEAD)) + if (test_bit(DLM_DFL_ORPHAN_BIT, &lkb->lkb_dflags) || + test_bit(DLM_IFL_DEAD_BIT, &lkb->lkb_iflags)) goto out; DLM_ASSERT(lkb->lkb_ua, dlm_print_lkb(lkb);); @@ -206,7 +208,7 @@ void dlm_user_add_ast(struct dlm_lkb *lkb, uint32_t flags, int mode, goto out; if ((flags & DLM_CB_CAST) && lkb_is_endoflife(mode, status)) - lkb->lkb_flags |= DLM_IFL_ENDOFLIFE; + set_bit(DLM_IFL_ENDOFLIFE_BIT, &lkb->lkb_iflags); spin_lock(&proc->asts_spin); @@ -229,7 +231,7 @@ void dlm_user_add_ast(struct dlm_lkb *lkb, uint32_t flags, int mode, } spin_unlock(&proc->asts_spin); - if (lkb->lkb_flags & DLM_IFL_ENDOFLIFE) { + if (test_bit(DLM_IFL_ENDOFLIFE_BIT, &lkb->lkb_iflags)) { /* N.B. spin_lock locks_spin, not asts_spin */ spin_lock(&proc->locks_spin); if (!list_empty(&lkb->lkb_ownqueue)) { @@ -259,14 +261,6 @@ 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 v6.2!\n" - "========================================================\n"); -#endif - ua = kzalloc(sizeof(struct dlm_user_args), GFP_NOFS); if (!ua) goto out; @@ -279,16 +273,9 @@ 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, @@ -297,16 +284,9 @@ 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; } @@ -884,7 +864,7 @@ static ssize_t device_read(struct file *file, char __user *buf, size_t count, goto try_another; case DLM_DEQUEUE_CALLBACK_LAST: list_del_init(&lkb->lkb_cb_list); - lkb->lkb_flags &= ~DLM_IFL_CB_PENDING; + clear_bit(DLM_IFL_CB_PENDING_BIT, &lkb->lkb_iflags); break; case DLM_DEQUEUE_CALLBACK_SUCCESS: break; |