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

   ## Summary
   
   This PR adds POSIX path-resolution infrastructure to `inode_search()`. It is
   independent of the hardlink infrastructure PR (both are based on master and
   can be reviewed in parallel), and provides the path-canonicalization
   primitives that later bug-fix PRs depend on.
   
   Changes (one upstream commit each), all touching only
   `fs/inode/fs_inodesearch.c` and `fs/inode/inode.h`:
   
   1. **fs/inode: format link path before resolving link target**
   2. **fs/inode: return ENOENT if pathname is empty in inode_search**
   3. **fs/inode: return ENOTDIR if a path prefix is not a directory**
   4. **fs/inode: change fs_heap to lib_get_tempbuffer/lib_put_tempbuffer** —
      moves the inode search-path buffer allocation onto the temp-buffer pool
      (updates the `RELEASE_SEARCH` macro and `desc->buffer`). This keeps the
      allocator consistent across the whole path-resolution logic.
   5. **fs/inode: support relative path when inode_search**
   6. **fs/inode: support path ending with '..' and '.' in inode_search**
   7. **fs/inode: return ENAMETOOLONG for path/filename longer than NAME_MAX**
   8. **fs/inode: fix off-by-one error in _inode_checkpath NAME_MAX check**
   
   ## Impact
   
   - Path resolution now returns the correct POSIX error codes
     (`ENOENT`/`ENOTDIR`/`ENAMETOOLONG`) and correctly handles relative paths
     and `.`/`..` segments.
   - The search-path buffer now uses `lib_get_tempbuffer`/`lib_put_tempbuffer`
     consistently (commit 4), so the allocation and release paths match.
   - No public API change; contained entirely within the inode search layer.
   
   ## Testing
   
   - Built `sim:nsh` — zero errors/warnings.
   - `tools/checkpatch.sh` passes on all changed lines.
   
   ---
   This is part of a filesystem enhancement stack. It is independent of the
   hardlink infrastructure PR and can be merged in either order. A later bug-fix
   PR depends on both this PR and the hardlink/backends PRs.
   


-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to