fs/ext: implement symlink support #414

Merged
dunkaist merged 4 commits from Matou1306/kolibrios:ext-symlinks into main 2026-05-15 19:21:33 +00:00
Contributor

Implement support for reading fast and slow symlinks to files and directories in the ext driver.
Add handling for nested symlinks and absolute/relative paths, with a max depth limit of 40.
Add ERROR_TOO_MANY_LINKS = 40 to fs_lfn.inc.
Fix the driver to ignore multiple slashes in the path.

I also created and ran umka tests to verify these changes.

Thanks to @dunkaist for the guidance on this.

Implement support for reading fast and slow symlinks to files and directories in the ext driver. Add handling for nested symlinks and absolute/relative paths, with a max depth limit of 40. Add `ERROR_TOO_MANY_LINKS = 40` to `fs_lfn.inc`. Fix the driver to ignore multiple slashes in the path. I also created and ran [umka tests](https://git.kolibrios.org/Matou1306/umka/compare/main...ext-fs-improvements) to verify these changes. Thanks to @dunkaist for the guidance on this.
Burer requested review from Doczom 2026-04-10 04:56:03 +00:00
Burer requested review from dunkaist 2026-04-10 04:56:04 +00:00
Matou1306 added 4 commits 2026-04-20 23:20:00 +00:00
Read symlink targets up to 60 bytes directly from the inode block array.
Read symlink targets longer than 60 bytes from the first allocated data block.
Add core mechanics for resolving both fast and slow symlinks in the ext driver.
Implement nested symlink resolution with boundary overflow checks to shift
the remaining path safely inside the symlink workspace.
Add SYMLINK_MAX_DEPTH tracking to prevent infinite loops.
Introduce ERROR_TOO_MANY_LINKS (40) when depth limit is exceeded.
Add logic to handle both absolute (root-based) and relative path targets.
fs/ext: improve style and standards alignment
Build system / Check kernel codestyle (pull_request) Successful in 2m19s
Build system / Build (pull_request) Successful in 19m8s
b70927011b
Finish up the symlink feature, following the style guide and removing
magic numbers.
Also update SYMLINK_MAX_DEPTH to 40 to match the Linux kernel.
Add brief explanatory comments.
Clean up local .gitignore unintentional pushes.

Implement ignoring multiple slashes in path for the ext driver.
Matou1306 force-pushed ext-symlinks from f9a65daf40 to b70927011b 2026-04-20 23:20:00 +00:00 Compare
dunkaist approved these changes 2026-05-11 19:01:03 +00:00
dunkaist left a comment
Owner

First I though to request some refactoring with splitting that huge function into smaller ones. But now I see that the whole file needs this kind of refactoring. So, this should be a separate effort. Looks ok as a start. Let's merge and continue on top of this. Tests for umka are provided separately (KolibriOS/umka#1) and they all pass

First I though to request some refactoring with splitting that huge function into smaller ones. But now I see that the whole file needs this kind of refactoring. So, this should be a separate effort. Looks ok as a start. Let's merge and continue on top of this. Tests for umka are provided separately (https://git.kolibrios.org/KolibriOS/umka/pulls/1) and they all pass
hidnplayr approved these changes 2026-05-15 17:43:54 +00:00
hidnplayr left a comment
Member

Looks legit, not sure about possible buffer overflows tough

Looks legit, not sure about possible buffer overflows tough
dunkaist merged commit e1a30a4f14 into main 2026-05-15 19:21:33 +00:00
dunkaist deleted branch ext-symlinks 2026-05-15 19:21:34 +00:00
Sign in to join this conversation.
3 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: KolibriOS/kolibrios#414