nuttx/fs/inode
wangxingxing ea4a4585cd fs/inode: fix off-by-one error in _inode_checkpath NAME_MAX check
The _inode_checkpath function uses `namelen < NAME_MAX` to validate
path segment lengths. When a filename is exactly NAME_MAX characters
long and is followed by more path segments (e.g. /dir/), the loop
exits with namelen == NAME_MAX before processing the '/' separator,
causing a spurious ENAMETOOLONG error.

Per POSIX, NAME_MAX is the maximum number of bytes in a filename not
including the terminating null, so a filename of exactly NAME_MAX
characters is valid. Change the condition to `namelen <= NAME_MAX`
so the loop can process the trailing '/' separator and correctly
reset namelen for the next path segment.

Signed-off-by: wangxingxing <wangxingxing@xiaomi.com>
2026-08-28 12:09:46 +08:00
..
CMakeLists.txt fs: migrate to SPDX identifier 2024-11-06 01:58:54 +08:00
fs_files.c nuttx/atomic: replace atomic_fetch_xxx with atomic_xxx just like zephyr 2026-08-24 13:20:45 +08:00
fs_foreachinode.c fs: migrate to SPDX identifier 2024-11-06 01:58:54 +08:00
fs_inode.c sched: add supplementary group IDs (setgroups/getgroups/initgroups) 2026-08-12 16:06:03 -03:00
fs_inodeaddref.c nuttx/atomic: replace atomic_fetch_xxx with atomic_xxx just like zephyr 2026-08-24 13:20:45 +08:00
fs_inodebasename.c fs: migrate to SPDX identifier 2024-11-06 01:58:54 +08:00
fs_inodefind.c nuttx/atomic: replace atomic_fetch_xxx with atomic_xxx just like zephyr 2026-08-24 13:20:45 +08:00
fs_inodefree.c fs: rename PSEUDOFS_SOFTLINKS to FS_LINKS 2026-08-27 01:12:33 +08:00
fs_inodegetpath.c fs: migrate to SPDX identifier 2024-11-06 01:58:54 +08:00
fs_inoderelease.c nuttx/atomic: replace atomic_fetch_xxx with atomic_xxx just like zephyr 2026-08-24 13:20:45 +08:00
fs_inoderemove.c fs: rename PSEUDOFS_SOFTLINKS to FS_LINKS 2026-08-27 01:12:33 +08:00
fs_inodereserve.c fs: enforce path search and unify inode permission helpers 2026-08-02 18:48:40 -03:00
fs_inodesearch.c fs/inode: fix off-by-one error in _inode_checkpath NAME_MAX check 2026-08-28 12:09:46 +08:00
inode.h fs/inode: change fs_heap to lib_get_tempbuffer/lib_put_tempbuffer 2026-08-28 12:09:46 +08:00
Make.defs fs: migrate to SPDX identifier 2024-11-06 01:58:54 +08:00