nuttx/sched/sched
Ville Juven b8e30b54ec fs/vfs: Separate file descriptors from file descriptions
This patch is a rework of the NuttX file descriptor implementation. The
goal is two-fold:

1. Improve POSIX compliance. The old implementation tied file description
to inode only, not the file struct. POSIX however dictates otherwise.
2. Fix a bug with descriptor duplication (dup2() and dup3()). There is
an existing race condition with this POSIX API that currently results
in a kernel side crash.

The crash occurs when a partially open / closed file descriptor is
duplicated. The reason for the crash is that even if the descriptor is
closed, the file might still be in use by the kernel (due to e.g. ongoing
write to file). The open file data is changed by file_dup3() and this
causes a crash in the device / drivers themselves as they lose access to
the inode and private data.

The fix is done by separating struct file into file and file descriptor
structs. The file struct can live on even if the descriptor is closed,
fixing the crash. This also fixes the POSIX issue, as two descriptors
can now point to the same file.

Signed-off-by: Ville Juven <ville.juven@unikie.com>
Signed-off-by: dongjiuzhu1 <dongjiuzhu1@xiaomi.com>
2025-06-12 18:12:42 +08:00
..
CMakeLists.txt sched: inline nxsched_select_cpu nxsched_add_prioritized to improve performence 2024-10-11 03:21:24 +08:00
Make.defs sched: inline nxsched_select_cpu nxsched_add_prioritized to improve performence 2024-10-11 03:21:24 +08:00
queue.h sched/queue: fix typo in dq_insert_mid macro 2025-05-08 15:59:50 +08:00
sched.h sched: remove csection and reduce the interrupt disabling time in sched_[un]lock 2025-01-23 19:58:49 +08:00
sched_addblocked.c sched: migrate to SPDX identifier 2024-09-12 01:10:14 +08:00
sched_addreadytorun.c comments: update text typo pre-empted to preempted 2025-05-12 15:01:37 +08:00
sched_backtrace.c sched: unify Private Types banners 2025-05-28 10:17:15 +08:00
sched_cpuload.c sched/wdog: Replace periodcial timer with the wd_start_next. 2025-06-10 11:02:45 -03:00
sched_cpuload_oneshot.c usleep: use div_const to optimize the usleep 2024-09-12 18:14:39 +08:00
sched_cpuload_period.c sched: migrate to SPDX identifier 2024-09-12 01:10:14 +08:00
sched_critmonitor.c sched/lockcount: replace all lockcount check to nxsched_islocked_tcb() 2024-11-26 16:35:20 +08:00
sched_dumponexit.c sched: delete the dump file list when the thread exits 2024-10-13 02:06:38 +08:00
sched_foreach.c sched: migrate to SPDX identifier 2024-09-12 01:10:14 +08:00
sched_get_stackinfo.c sched: migrate to SPDX identifier 2024-09-12 01:10:14 +08:00
sched_get_stateinfo.c Clean up the nxmutex library 2025-05-08 16:00:05 +08:00
sched_get_tls.c sched: migrate to SPDX identifier 2024-09-12 01:10:14 +08:00
sched_getaffinity.c sched: migrate to SPDX identifier 2024-09-12 01:10:14 +08:00
sched_getcpu.c sched: export sched_getcpu API in AMP mode 2024-10-09 15:21:25 +08:00
sched_getfiles.c fs/vfs: Separate file descriptors from file descriptions 2025-06-12 18:12:42 +08:00
sched_getparam.c clock: Replace all ts and tick conversion functions 2024-09-12 18:14:39 +08:00
sched_getscheduler.c sched: migrate to SPDX identifier 2024-09-12 01:10:14 +08:00
sched_gettcb.c sched: migrate to SPDX identifier 2024-09-12 01:10:14 +08:00
sched_idletask.c sched: migrate to SPDX identifier 2024-09-12 01:10:14 +08:00
sched_lock.c sched: remove csection and reduce the interrupt disabling time in sched_[un]lock 2025-01-23 19:58:49 +08:00
sched_lockcount.c sched: migrate to SPDX identifier 2024-09-12 01:10:14 +08:00
sched_mergepending.c sched/lockcount: replace all lockcount check to nxsched_islocked_tcb() 2024-11-26 16:35:20 +08:00
sched_mergeprioritized.c sched: migrate to SPDX identifier 2024-09-12 01:10:14 +08:00
sched_process_delivered.c sched/spin_lock: rename raw_spin_lock to spin_lock_notrace 2025-02-13 20:48:15 +08:00
sched_processtimer.c fix compiler error 2024-11-11 19:48:38 +08:00
sched_profil.c sched/wdog: Replace periodcial timer with the wd_start_next. 2025-06-10 11:02:45 -03:00
sched_releasetcb.c style: fix spelling in code comments and strings 2025-05-23 10:48:41 +08:00
sched_removeblocked.c sched: migrate to SPDX identifier 2024-09-12 01:10:14 +08:00
sched_removereadytorun.c sched: add up_this_task and up_change_task macro stub 2024-10-15 15:25:55 +08:00
sched_reprioritize.c sched: migrate to SPDX identifier 2024-09-12 01:10:14 +08:00
sched_reprioritizertr.c sched: remove param in nxsched_remove_readytorun 2024-10-10 08:44:52 +08:00
sched_resumescheduler.c nuttx/sched:Modify the comment error in sched_resumescheduler.c 2024-10-15 21:05:36 +08:00
sched_roundrobin.c sched: unify Private Types banners 2025-05-28 10:17:15 +08:00
sched_rrgetinterval.c sched: migrate to SPDX identifier 2024-09-12 01:10:14 +08:00
sched_self.c sched: migrate to SPDX identifier 2024-09-12 01:10:14 +08:00
sched_setaffinity.c sched/sched: change [FIRST|LAST]_ASSIGNED_STATE to [FIRST|LAST]_READY_TO_RUN_STATE in nxsched_set_affinity 2024-11-04 17:19:59 +08:00
sched_setparam.c clock: Replace all ts and tick conversion functions 2024-09-12 18:14:39 +08:00
sched_setpriority.c sched: unify Private Types banners 2025-05-28 10:17:15 +08:00
sched_setscheduler.c sched: simplify call of get current tcb 2025-03-18 00:22:37 +02:00
sched_smp.c smpcall: we directly call the function to handle local smpcall 2024-11-07 09:25:11 +09:00
sched_sporadic.c sched: migrate to SPDX identifier 2024-09-12 01:10:14 +08:00
sched_suspend.c sched: unify Private Types banners 2025-05-28 10:17:15 +08:00
sched_suspendscheduler.c sched: fix nxsched_suspend_scheduler regression 2024-10-13 10:16:22 +08:00
sched_sysinfo.c sched: fix warning 2024-10-12 09:29:37 +08:00
sched_timerexpiration.c clock: Fix timing error. 2025-05-12 19:56:29 +08:00
sched_unlock.c sched: remove csection and reduce the interrupt disabling time in sched_[un]lock 2025-01-23 19:58:49 +08:00
sched_verifytcb.c sched: migrate to SPDX identifier 2024-09-12 01:10:14 +08:00
sched_wait.c sched: migrate to SPDX identifier 2024-09-12 01:10:14 +08:00
sched_waitid.c sched: migrate to SPDX identifier 2024-09-12 01:10:14 +08:00
sched_waitpid.c sched: migrate to SPDX identifier 2024-09-12 01:10:14 +08:00
sched_yield.c sched: migrate to SPDX identifier 2024-09-12 01:10:14 +08:00