cederom commented on PR #21907:
URL: https://github.com/apache/nuttx/pull/21907#issuecomment-7248258907

   Thanks @casaroli. I compared `6b3bd40..bad82b8` with `git range-diff`. 
Besides the rebase there are three changes:
   
   **1. `fs_cwd_join()` (smaller, same behaviour).** One `snprintf()` path now 
covers home and a set directory. Home still gets the caller's root in front. A 
host-path `tg_cwd` sets `root = NULL`, because the root is already in it. A 
removed directory and a directory outside the root still give `-ENOENT`. The 
return value is still the size needed including the NUL, so the retry with a 
larger buffer in `inode_search_setup()` is unchanged. OK.
   
   **2. `getcwd()` (smaller, same behaviour).** I traced the cases:
   - `buf != NULL, size == 0` → `EINVAL`
   - `buf == NULL`, allocation fails → `ENOMEM` (`kumm_free(NULL)` is harmless)
   - `buf == NULL, size == 0` → `PATH_MAX` bytes
   - otherwise the `cwd_get()` result, with `ERANGE`/`ENOENT`
   
   OK.
   
   **3. `fs_rename.c`.** The rebase removed the `subdir` cleanup from the 
context (master changed `pseudorename()`). `fs_cwd_renamed()` still runs after 
`inode_unlock()` and only on success. In `mountptrename()` it runs before 
`errout_with_newinode`, with `oldisdir` from the file system's `stat`/`lstat`. 
One note, no change needed: a file system without `stat` never updates the 
current directories on a directory rename. That's acceptable, since all in-tree 
mount-point file systems implement `stat`.
   
   **4. imx93-qsb:rpmsg.** Master grew, so the board now also needs 
`CONFIG_NSH_DISABLE_UPTIME=y` on top of `FS_CWD_TRACKING=n` (about 400 bytes of 
ITCM were free before this series, about 1 KiB after). That seems like a fair 
trade, but the board owner should ack it, as for the SysV message queues on 
sam3u-ek:knsh.
   
   The other commits are unchanged. My non-blocking notes from last time (the 
early `cwd_find("/")` walk, `ENAMETOOLONG` for a deep relative 
`nftw(FTW_CHDIR)` walk) still stand as possible follow-ups, not as conditions 
for merging.
   
   LGTM, my approval stands. Please let CI / MemBrowse run on `bad82b8`, since 
the size numbers come from local builds.


-- 
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