You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by "casaroli (via GitHub)" <gi...@apache.org> on 2026/10/08 20:34:08 UTC
[PR] fs/v9fs: Report the end of a directory and set st_ino and d_ino. [nuttx]
casaroli opened a new pull request, #20525:
URL: https://github.com/apache/nuttx/pull/20525
## Summary
Two v9fs fixes, and one style-only commit for an nxstyle error in `v9fs.c`.
* `readdir()` ended every directory with `errno` set to `EIO`. At the end of a directory the 9P server returns no entries, and `v9fs_client_convertdir()` returned `-EIO`. `v9fs_vfs_readdir()` now returns `-ENOENT`, which the VFS treats as the end of the directory. The bounds check for the fixed part of an entry now uses the bytes left after `head`, not the whole buffer.
* `stat()` returned `st_ino` 0 and `readdir()` returned `d_ino` 0 for every file. Both now come from the qid path of the file, folded into `ino_t` the same way, and never 0. Programs that skip directory entries with `d_ino` 0, or compare `st_dev`/`st_ino`, then work on a v9fs mount.
## Impact
v9fs only. No new options.
## Testing
qemu-armv8a in QEMU 11 (TCG), kernel build with v9fs over virtio-9p (`-fsdev local,... -device virtio-9p-device,...`). A test program walks directories with `readdir()` and prints `d_ino`, `d_type` and `errno` at the end:
```
nsh> dirprobe /mnt/proj/src /dev
/mnt/proj/src: d_ino=163294653 d_type=8 a.in
/mnt/proj/src: d_ino=163294657 d_type=8 c.in
/mnt/proj/src: d_ino=163294655 d_type=8 b.in
/mnt/proj/src: end, errno=0
/dev: d_ino=3 d_type=2 console
...
/dev: end, errno=0
```
Before the change, a program that checks `errno` after `readdir()` reported `readdir .: I/O error` on the same mount, and a program that skips entries with `d_ino` 0 saw the directory as empty.
Builds: `qemu-armv8a:netnsh` (v9fs enabled) and `qemu-armv8a:knsh`.
--
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] fs/v9fs: Report the end of a directory and set st_ino and d_ino. [nuttx]
Posted by "acassis (via GitHub)" <gi...@apache.org>.
acassis merged PR #20525:
URL: https://github.com/apache/nuttx/pull/20525
--
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] fs/v9fs: Report the end of a directory and set st_ino and d_ino. [nuttx]
Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #20525:
URL: https://github.com/apache/nuttx/pull/20525#issuecomment-6068700307
<!-- membrowse-pr-comment -->
## <img src="https://membrowse.com/membrowse-logo.svg" height="24" align="top"> MemBrowse Memory Report
*No memory changes detected for:*
- [arduino-mega2560](https://membrowse.com/public/apache/nuttx/target/arduino-mega2560/compare?head=d23733b134b3c1931b93ecbe8dc5255383a995ac&base=b38a6e0f56f04091b55b2e3f0ce44c05696dd677)
- [esp32-devkitc](https://membrowse.com/public/apache/nuttx/target/esp32-devkitc/compare?head=d23733b134b3c1931b93ecbe8dc5255383a995ac&base=b38a6e0f56f04091b55b2e3f0ce44c05696dd677)
- [hifive1-revb](https://membrowse.com/public/apache/nuttx/target/hifive1-revb/compare?head=d23733b134b3c1931b93ecbe8dc5255383a995ac&base=b38a6e0f56f04091b55b2e3f0ce44c05696dd677)
- [mirtoo](https://membrowse.com/public/apache/nuttx/target/mirtoo/compare?head=d23733b134b3c1931b93ecbe8dc5255383a995ac&base=b38a6e0f56f04091b55b2e3f0ce44c05696dd677)
- [qemu-armv8a](https://membrowse.com/public/apache/nuttx/target/qemu-armv8a/compare?head=d23733b134b3c1931b93ecbe8dc5255383a995ac&base=b38a6e0f56f04091b55b2e3f0ce44c05696dd677)
- [qemu-intel64](https://membrowse.com/public/apache/nuttx/target/qemu-intel64/compare?head=d23733b134b3c1931b93ecbe8dc5255383a995ac&base=b38a6e0f56f04091b55b2e3f0ce44c05696dd677)
- [rx65n-rsk2mb](https://membrowse.com/public/apache/nuttx/target/rx65n-rsk2mb/compare?head=d23733b134b3c1931b93ecbe8dc5255383a995ac&base=b38a6e0f56f04091b55b2e3f0ce44c05696dd677)
- [s698pm-dkit](https://membrowse.com/public/apache/nuttx/target/s698pm-dkit/compare?head=d23733b134b3c1931b93ecbe8dc5255383a995ac&base=b38a6e0f56f04091b55b2e3f0ce44c05696dd677)
- [stm32-nucleo-f103rb](https://membrowse.com/public/apache/nuttx/target/stm32-nucleo-f103rb/compare?head=d23733b134b3c1931b93ecbe8dc5255383a995ac&base=b38a6e0f56f04091b55b2e3f0ce44c05696dd677)
--
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] fs/v9fs: Report the end of a directory and set st_ino and d_ino. [nuttx]
Posted by "xiaoxiang781216 (via GitHub)" <gi...@apache.org>.
xiaoxiang781216 commented on code in PR #20525:
URL: https://github.com/apache/nuttx/pull/20525#discussion_r4226648374
##########
fs/v9fs/client.c:
##########
@@ -378,6 +378,24 @@ struct v9fs_fid_s
* Private Functions
****************************************************************************/
+/****************************************************************************
+ * Name: v9fs_qid_ino
+ *
+ * Description:
+ * Return the file serial number (st_ino, d_ino) for a qid path. The
+ * qid path identifies the file on the server; it is folded into ino_t
+ * and never 0, because programs such as GNU make skip directory entries
+ * with d_ino 0.
+ *
+ ****************************************************************************/
+
+static ino_t v9fs_qid_ino(uint64_t path)
Review Comment:
inline
--
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