Zeke-OS / zeke

A POSIX-like OS for ARM processors.
Other
86 stars 9 forks source link

getcwd() is broken #165

Closed OlliV closed 4 years ago

OlliV commented 4 years ago

Something in the reverse lookup is broken because every directly at the root level is shown as boot. E.g. /usr/examples is shown as /boot/examples. This might be caused by a bug in fatfs, and not fs subsystem itself.

OlliV commented 4 years ago

The issue is that we see .. always as inode 0 for fatfs.

OlliV commented 4 years ago

and the reason is here: https://github.com/Zeke-OS/zeke/blob/37df35becaeef09b975a763388063882db6bf39c/kern/fs/fatfs/fatfs.c#L883-L885

OlliV commented 4 years ago

The ino calculation is not reliable. Sometimes directories get different values depending on if we are doing readdir on . or statting the directory.