BUG/MEDIUM: tasks: Make tasklet_remove_from_tasklet_list() no matter the tasklet.

In tasklet_remove_from_tasket_list(), we can be called for a tasklet that is
either in the private task list, or in the shared tasklet list. Take that into
account and always use MT_LIST_DEL() to remove it, otherwise if we're in the
shared list and another thread attempts to add a tasklet in it, bad things
will happen.

__tasklet_remove_from_tasklet_list() is left unchanged, it's only supposed
to be used by process_runnable_task() to remove task/tasklets from the private
tast list.

This should not be backported.
This should fix github issue #357.
This commit is contained in:
Olivier Houchard 2019-11-08 15:41:55 +01:00 committed by Olivier Houchard
parent 2f44e8843a
commit 7031e3dace

View File

@ -270,8 +270,8 @@ static inline void __tasklet_remove_from_tasklet_list(struct tasklet *t)
static inline void tasklet_remove_from_tasklet_list(struct tasklet *t)
{
if (likely(!LIST_ISEMPTY(&t->list)))
__tasklet_remove_from_tasklet_list(t);
if (MT_LIST_DEL((struct mt_list *)&t->list))
_HA_ATOMIC_SUB(&tasks_run_queue, 1);
}
/*