From e17c2d3e57eebd8b3605fb7eb765dc05ca3bca80 Mon Sep 17 00:00:00 2001 From: Olivier Houchard Date: Tue, 17 Jul 2018 18:29:22 +0200 Subject: [PATCH] MINOR: tasklets: Don't attempt to add a tasklet in the list twice. Don't try to add a tasklet to the run queue if it's already in there, or we might get an infinite loop. --- include/proto/task.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/include/proto/task.h b/include/proto/task.h index d1371f3b0..8aceee508 100644 --- a/include/proto/task.h +++ b/include/proto/task.h @@ -205,6 +205,8 @@ static inline struct task *task_unlink_rq(struct task *t) static inline void tasklet_wakeup(struct tasklet *tl) { + if (!LIST_ISEMPTY(&tl->list)) + return; LIST_ADDQ(&task_list[tid], &tl->list); task_list_size[tid]++; HA_ATOMIC_ADD(&tasks_run_queue, 1);