diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2018-12-28 03:49:24 +0300 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2018-12-28 03:49:24 +0300 |
commit | 4de3aea385f5a054885bc96ffdb9c7d0ea0c9486 (patch) | |
tree | 3a3641390ff8e6756b8c7592959c7ac8afa2c8f1 /fs/dlm/ast.c | |
parent | 32ee34eddad13cd44ad0cb3e659fe6fd49143b62 (diff) | |
parent | 3595c559326d0b660bb088a88e22e0ca630a0e35 (diff) | |
download | linux-4de3aea385f5a054885bc96ffdb9c7d0ea0c9486.tar.xz |
Merge tag 'dlm-4.21' of git://git.kernel.org/pub/scm/linux/kernel/git/teigland/linux-dlm
Pull dlm updates from David Teigland:
"This set is entirely trivial fixes, mainly around correct cleanup on
error paths and improved error checks. One patch adds scheduling in a
potentially long recovery loop"
* tag 'dlm-4.21' of git://git.kernel.org/pub/scm/linux/kernel/git/teigland/linux-dlm:
dlm: fix invalid cluster name warning
dlm: NULL check before some freeing functions is not needed
dlm: NULL check before kmem_cache_destroy is not needed
dlm: fix missing idr_destroy for recover_idr
dlm: memory leaks on error path in dlm_user_request()
dlm: lost put_lkb on error path in receive_convert() and receive_unlock()
dlm: possible memory leak on error path in create_lkb()
dlm: fixed memory leaks after failed ls_remove_names allocation
dlm: fix possible call to kfree() for non-initialized pointer
dlm: Don't swamp the CPU with callbacks queued during recovery
dlm: don't leak kernel pointer to userspace
dlm: don't allow zero length names
dlm: fix invalid free
Diffstat (limited to 'fs/dlm/ast.c')
-rw-r--r-- | fs/dlm/ast.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/fs/dlm/ast.c b/fs/dlm/ast.c index 562fa8c3edff..47ee66d70109 100644 --- a/fs/dlm/ast.c +++ b/fs/dlm/ast.c @@ -292,6 +292,8 @@ void dlm_callback_suspend(struct dlm_ls *ls) flush_workqueue(ls->ls_callback_wq); } +#define MAX_CB_QUEUE 25 + void dlm_callback_resume(struct dlm_ls *ls) { struct dlm_lkb *lkb, *safe; @@ -302,15 +304,23 @@ void dlm_callback_resume(struct dlm_ls *ls) if (!ls->ls_callback_wq) return; +more: mutex_lock(&ls->ls_cb_mutex); list_for_each_entry_safe(lkb, safe, &ls->ls_cb_delay, lkb_cb_list) { list_del_init(&lkb->lkb_cb_list); queue_work(ls->ls_callback_wq, &lkb->lkb_cb_work); count++; + if (count == MAX_CB_QUEUE) + break; } mutex_unlock(&ls->ls_cb_mutex); if (count) log_rinfo(ls, "dlm_callback_resume %d", count); + if (count == MAX_CB_QUEUE) { + count = 0; + cond_resched(); + goto more; + } } |