Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge branch 'fix-for-bpf_wq-retry-loop-during-free'

Kumar Kartikeya Dwivedi says:

====================
Fix for bpf_wq retry loop during free

Small fix and improvement to ensure cancel_work() can handle the case
where wq callback is running, and doesn't lead to call_rcu_tasks_trace()
repeatedly after failing cancel_work, if wq callback is not pending.
====================

Link: https://patch.msgid.link/20260205003853.527571-1-memxor@gmail.com
Signed-off-by: Alexei Starovoitov <ast@kernel.org>

+2 -1
+2 -1
kernel/bpf/helpers.c
··· 1257 1257 retry = true; 1258 1258 break; 1259 1259 case BPF_ASYNC_TYPE_WQ: 1260 - if (!cancel_work(&w->work)) 1260 + if (!cancel_work(&w->work) && work_busy(&w->work)) 1261 1261 retry = true; 1262 1262 break; 1263 1263 } ··· 1664 1664 if (!cb) 1665 1665 return; 1666 1666 1667 + bpf_async_update_prog_callback(cb, NULL, NULL); 1667 1668 /* 1668 1669 * No refcount_inc_not_zero(&cb->refcnt) here. Dropping the last 1669 1670 * refcnt. Either synchronously or asynchronously in irq_work.