You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by "raiden00pl (via GitHub)" <gi...@apache.org> on 2026/09/11 07:43:21 UTC

[PR] sched/wqueue: restore -ENOENT from work_cancel() for unqueued work [nuttx]

raiden00pl opened a new pull request, #20112:
URL: https://github.com/apache/nuttx/pull/20112

   
   ## Summary
   
   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 d2e01b90553 ("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.
   
   taken from #20030
   
   ## Impact
   
   required for SMP intel64 to pass LPT tests
   
   ## Testing
   
   Summary
   various issues with AIO found by NTFC with LPT tests:
   
   sched/wqueue: restore -ENOENT from work_cancel() for unqueued work
   libs/libc/aio: fix nxstyle issues in lio_listio.c
   libs/libc/aio: fix lio_listio() racing with early I/O completion
   fs/aio: advance the pending list in aio_cancel() before work_cancel()
   fs/aio: decant the container only after the I/O has been performed
   taken from #20030
   
   Impact
   required for SMP intel64 to pass LPT tests
   
   Testing
   CI pass: https://github.com/apache/nuttx/actions/runs/34236734404/job/102183306099?pr=20030


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] sched/wqueue: restore -ENOENT from work_cancel() for unqueued work [nuttx]

Posted by "xiaoxiang781216 (via GitHub)" <gi...@apache.org>.
xiaoxiang781216 merged PR #20112:
URL: https://github.com/apache/nuttx/pull/20112


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] sched/wqueue: restore -ENOENT from work_cancel() for unqueued work [nuttx]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #20112:
URL: https://github.com/apache/nuttx/pull/20112#issuecomment-5631279240

   <!-- membrowse-pr-comment -->
   ## <img src="https://membrowse.com/membrowse-logo.svg" height="24" align="top"> MemBrowse Memory Report
   
   ### [qemu-armv8a](https://membrowse.com/public/apache/nuttx/target/qemu-armv8a/compare?head=81efe031412c98782d2c47e31b25a274257cf848&base=28fe1fab72fba19ad9e2fd75c8189cf4ac2e2121)
     - **Code**: .text.work_qcancel +20 B (+0.0%, 336,928 B)
   *No memory changes detected for:*
   - [arduino-mega2560](https://membrowse.com/public/apache/nuttx/target/arduino-mega2560/compare?head=81efe031412c98782d2c47e31b25a274257cf848&base=28fe1fab72fba19ad9e2fd75c8189cf4ac2e2121)
   - [esp32-devkitc](https://membrowse.com/public/apache/nuttx/target/esp32-devkitc/compare?head=81efe031412c98782d2c47e31b25a274257cf848&base=28fe1fab72fba19ad9e2fd75c8189cf4ac2e2121)
   - [hifive1-revb](https://membrowse.com/public/apache/nuttx/target/hifive1-revb/compare?head=81efe031412c98782d2c47e31b25a274257cf848&base=28fe1fab72fba19ad9e2fd75c8189cf4ac2e2121)
   - [mirtoo](https://membrowse.com/public/apache/nuttx/target/mirtoo/compare?head=81efe031412c98782d2c47e31b25a274257cf848&base=28fe1fab72fba19ad9e2fd75c8189cf4ac2e2121)
   - [qemu-intel64](https://membrowse.com/public/apache/nuttx/target/qemu-intel64/compare?head=81efe031412c98782d2c47e31b25a274257cf848&base=28fe1fab72fba19ad9e2fd75c8189cf4ac2e2121)
   - [rx65n-rsk2mb](https://membrowse.com/public/apache/nuttx/target/rx65n-rsk2mb/compare?head=81efe031412c98782d2c47e31b25a274257cf848&base=28fe1fab72fba19ad9e2fd75c8189cf4ac2e2121)
   - [s698pm-dkit](https://membrowse.com/public/apache/nuttx/target/s698pm-dkit/compare?head=81efe031412c98782d2c47e31b25a274257cf848&base=28fe1fab72fba19ad9e2fd75c8189cf4ac2e2121)
   - [stm32-nucleo-f103rb](https://membrowse.com/public/apache/nuttx/target/stm32-nucleo-f103rb/compare?head=81efe031412c98782d2c47e31b25a274257cf848&base=28fe1fab72fba19ad9e2fd75c8189cf4ac2e2121)
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org