nuttx/sched
raiden00pl 5a209a853e
Some checks are pending
MemBrowse Memory Report / changes-filter (push) Waiting to run
MemBrowse Memory Report / load-targets (push) Waiting to run
MemBrowse Memory Report / identical (push) Blocked by required conditions
MemBrowse Memory Report / analyze (push) Blocked by required conditions
sched/wqueue: restore -ENOENT from work_cancel() for unqueued work
work_cancel() used to return -ENOENT when the work structure was not
in the queue, and callers depend on that: aio_cancel() tears down the
AIO container (file_put() + aioc_free()) only when work_cancel()
reports success, because a work item that is not queued may already be
executing on a worker thread (see the comment in fs/aio/aio_cancel.c).

Since commit 6f72f5481d ("sched/wqueue: Refactor delayed and periodical
workqueue") work_cancel() returns OK unconditionally, and commit
d2e01b9055 ("sched/wqueue: harden custom queue lifecycle") kept that
behaviour and dropped -ENOENT from the function documentation.  Under
SMP the LTP aio_cancel tests then free the aio container and its file
while the lpwork thread is still executing aio_write_worker() on it,
which ends in a page fault in file_write() (f_inode == NULL) and a
panic.

Return -ENOENT again when the work is not queued, and document it.
For the synchronous variant "not queued" alone does not tell whether
the callback is running: the worker scan does, so report OK when a
running callback was found and waited for, and -ENOENT only when the
work was neither queued nor running.

Assisted-by: Claude Code
Signed-off-by: raiden00pl <raiden00@railab.me>
2026-09-13 11:31:41 +08:00
..
addrenv nuttx/atomic: replace atomic_fetch_xxx with atomic_xxx just like zephyr 2026-08-24 13:20:45 +08:00
clock sched/clock: Fix timekeeping adjtime convergence. 2026-09-13 11:12:56 +08:00
environ sched/environ: Serialize clearenv updates. 2026-09-09 10:22:01 +08:00
event sched/event: Fix uninitialized need_switch flag issue in event_post() 2025-11-04 21:43:59 +08:00
group sched: add setresuid and setresgid 2026-08-12 16:06:03 -03:00
hrtimer sched/hrtimer: Fix reprogram with wrong expiration when reinserting hrtimer 2026-09-07 10:17:46 -03:00
init arch, sched/signal: Fix compilation with ENABLE_PARTIAL_SIGNALS=y 2026-06-16 17:07:32 +08:00
instrument gprof: move gprof function from sched to libbuiltin/libgcc 2024-11-13 02:42:31 +08:00
irq !include/fcntl.h: align open flags with Linux values 2026-06-30 13:43:44 +08:00
misc sched: avoid dumping raw memory at address 0 for tasks without kstack 2026-07-20 20:57:45 -03:00
module libc/dlfcn: Count opens so a library can be shared. 2026-08-04 11:12:49 -03:00
mqueue !include/fcntl.h: align open flags with Linux values 2026-06-30 13:43:44 +08:00
paging include/debug.h: Move to include/nuttx/debug.h 2026-04-07 07:50:06 -03:00
pthread sched: Centralize sporadic parameter validation 2026-09-13 10:29:49 +08:00
sched sched: Centralize sporadic parameter validation 2026-09-13 10:29:49 +08:00
semaphore nuttx/atomic: replace atomic_fetch_xxx with atomic_xxx just like zephyr 2026-08-24 13:20:45 +08:00
signal sched/signal: Unblock sigtimedwait through kernel memory. 2026-08-08 14:59:21 -03:00
task sched/spawn: Propagate scheduler setup errors 2026-09-13 10:29:49 +08:00
timer !sys/types.h: change time_t and clock_t to int64_t to align with other OSes 2026-05-19 16:21:28 +08:00
tls sched: Fix stdio initialization of standard streams when buffering is disabled 2026-08-18 15:19:45 -03:00
wdog !sys/types.h: change time_t and clock_t to int64_t to align with other OSes 2026-05-19 16:21:28 +08:00
wqueue sched/wqueue: restore -ENOENT from work_cancel() for unqueued work 2026-09-13 11:31:41 +08:00
CMakeLists.txt sched: migrate to SPDX identifier 2024-09-12 01:10:14 +08:00
Kconfig arch/atomic: remove up_testset in spinlock 2026-09-08 08:58:54 +08:00
Makefile tools: fix stale archive members surviving a Kconfig-driven CSRCS change 2026-07-28 21:26:03 -03:00