]> Projects (at) Tadryanom (dot) Me - AdrOS.git/commit
fs: fix ext2 readdir visibility and ls single-file output
authorTulio A M Mendes <[email protected]>
Tue, 9 Jun 2026 02:59:34 +0000 (23:59 -0300)
committerTulio A M Mendes <[email protected]>
Tue, 9 Jun 2026 02:59:34 +0000 (23:59 -0300)
commitdb16681b75cb07e939610a45db8f195dc0216cac
treecd67af25c337da5092ba1e4fabbb31c7806bd682
parentdcc9ea8f8be8e6758c3dd0208fd4d942a3493bc2
fs: fix ext2 readdir visibility and ls single-file output

Corrected:
- fix ext2 directory iteration so readdir accepts valid exact-fit ext2 dirents instead of rejecting entries where name_len == rec_len - 8
- restore visibility of pre-existing files on ext2 mounts when listing directories with ls/getdents
- fix the userland ls command so path arguments are stat'ed first and handled as either directories or standalone files
- make 'ls -l /disk/outro.txt' and 'ls -l /disk2/outro.txt' print the expected single-file output instead of treating regular files like directories and producing no output

Changed:
- refactor ls formatting through a shared print_entry() helper reused by both directory listings and direct file-path listings

Validation:
- ext2 directory listing regression reproduced from mounted host image and corrected in src/kernel/ext2.c
- make test passes after the changes
src/kernel/ext2.c
user/cmds/ls/ls.c