Commit 740bb8fc authored by Alexander Aring's avatar Alexander Aring Committed by David Teigland

fs: dlm: ast do WARN_ON_ONCE() on hotpath

This patch changes the ast hotpath functionality in very unlikely cases
that we do WARN_ON_ONCE() instead of WARN_ON() to not spamming the
console output if we run into states that it would occur over and over
again.
Signed-off-by: default avatarAlexander Aring <aahringo@redhat.com>
Signed-off-by: default avatarDavid Teigland <teigland@redhat.com>
parent 9267c857
...@@ -161,12 +161,12 @@ void dlm_add_cb(struct dlm_lkb *lkb, uint32_t flags, int mode, int status, ...@@ -161,12 +161,12 @@ void dlm_add_cb(struct dlm_lkb *lkb, uint32_t flags, int mode, int status,
spin_unlock(&ls->ls_cb_lock); spin_unlock(&ls->ls_cb_lock);
break; break;
case DLM_ENQUEUE_CALLBACK_FAILURE: case DLM_ENQUEUE_CALLBACK_FAILURE:
WARN_ON(1); WARN_ON_ONCE(1);
break; break;
case DLM_ENQUEUE_CALLBACK_SUCCESS: case DLM_ENQUEUE_CALLBACK_SUCCESS:
break; break;
default: default:
WARN_ON(1); WARN_ON_ONCE(1);
break; break;
} }
spin_unlock(&lkb->lkb_cb_lock); spin_unlock(&lkb->lkb_cb_lock);
...@@ -185,7 +185,7 @@ void dlm_callback_work(struct work_struct *work) ...@@ -185,7 +185,7 @@ void dlm_callback_work(struct work_struct *work)
rv = dlm_dequeue_lkb_callback(lkb, &cb); rv = dlm_dequeue_lkb_callback(lkb, &cb);
spin_unlock(&lkb->lkb_cb_lock); spin_unlock(&lkb->lkb_cb_lock);
if (WARN_ON(rv == DLM_DEQUEUE_CALLBACK_EMPTY)) if (WARN_ON_ONCE(rv == DLM_DEQUEUE_CALLBACK_EMPTY))
goto out; goto out;
for (;;) { for (;;) {
......
...@@ -214,7 +214,7 @@ void dlm_user_add_ast(struct dlm_lkb *lkb, uint32_t flags, int mode, ...@@ -214,7 +214,7 @@ void dlm_user_add_ast(struct dlm_lkb *lkb, uint32_t flags, int mode,
switch (rv) { switch (rv) {
case DLM_ENQUEUE_CALLBACK_FAILURE: case DLM_ENQUEUE_CALLBACK_FAILURE:
spin_unlock(&proc->asts_spin); spin_unlock(&proc->asts_spin);
WARN_ON(1); WARN_ON_ONCE(1);
goto out; goto out;
case DLM_ENQUEUE_CALLBACK_NEED_SCHED: case DLM_ENQUEUE_CALLBACK_NEED_SCHED:
kref_get(&lkb->lkb_ref); kref_get(&lkb->lkb_ref);
...@@ -224,7 +224,7 @@ void dlm_user_add_ast(struct dlm_lkb *lkb, uint32_t flags, int mode, ...@@ -224,7 +224,7 @@ void dlm_user_add_ast(struct dlm_lkb *lkb, uint32_t flags, int mode,
case DLM_ENQUEUE_CALLBACK_SUCCESS: case DLM_ENQUEUE_CALLBACK_SUCCESS:
break; break;
default: default:
WARN_ON(1); WARN_ON_ONCE(1);
break; break;
} }
spin_unlock(&proc->asts_spin); spin_unlock(&proc->asts_spin);
...@@ -880,7 +880,7 @@ static ssize_t device_read(struct file *file, char __user *buf, size_t count, ...@@ -880,7 +880,7 @@ static ssize_t device_read(struct file *file, char __user *buf, size_t count,
spin_unlock(&proc->asts_spin); spin_unlock(&proc->asts_spin);
/* removes ref for proc->asts, may cause lkb to be freed */ /* removes ref for proc->asts, may cause lkb to be freed */
dlm_put_lkb(lkb); dlm_put_lkb(lkb);
WARN_ON(1); WARN_ON_ONCE(1);
goto try_another; goto try_another;
case DLM_DEQUEUE_CALLBACK_LAST: case DLM_DEQUEUE_CALLBACK_LAST:
list_del_init(&lkb->lkb_cb_list); list_del_init(&lkb->lkb_cb_list);
...@@ -890,7 +890,7 @@ static ssize_t device_read(struct file *file, char __user *buf, size_t count, ...@@ -890,7 +890,7 @@ static ssize_t device_read(struct file *file, char __user *buf, size_t count,
case DLM_DEQUEUE_CALLBACK_SUCCESS: case DLM_DEQUEUE_CALLBACK_SUCCESS:
break; break;
default: default:
WARN_ON(1); WARN_ON_ONCE(1);
break; break;
} }
spin_unlock(&proc->asts_spin); spin_unlock(&proc->asts_spin);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment