New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
lib/*fs, lib/vfscore: Add proper dirent/dirent64
structure usage
#963
lib/*fs, lib/vfscore: Add proper dirent/dirent64
structure usage
#963
Conversation
Just a more general comment, but would it be a good idea to use |
cc232ab
to
096a74e
Compare
Done @skuenzer, I moved the config option in vfscore, it will get enabled by default if the syscall handler is enabled. Also added the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks a lot for providing the fix, @StefanJum. I have provided some nitpicks.
I will approve the PR after that! 💪
096a74e
to
99e3832
Compare
Done @RaduNichita, thank you. |
99e3832
to
bbd9730
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All good now. Thanks, @StefanJum! 💯
Reviewed-by: Radu Nichita radunichita99@gmail.com
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks cool to me, some comments for your notification box 📫.
39d3f14
to
d30cc32
Compare
d30cc32
to
093be54
Compare
All done @skuenzer, sorry for the force-push spam, there were some checkpatch and ci/cd issues. |
The checkpatch is getting confused by the function pointer argument here 😆 |
The whole |
Yes, it's absolutely hideous, I just copied the |
Because I am seeing this here:
the following achieves exactly the same (except it does not check for < 0, but it is fine to assume a CONFIG to be set to 0(and undefined) or 1):
The preprocessor handles the case of being not defined correctly. |
093be54
to
d9278e0
Compare
I did not know that 👀 Pushed the change. |
d9278e0
to
cf088c3
Compare
Updated @skuenzer, thanks. |
2487f8e
to
9089d20
Compare
Unikraft defines the `dirent` structure as identical to `dirent64`. This works fine if not using Unikraft in binary compatibility mode, since we have total control over the internal functions/structures that are used. However, if we use Unikraft in binary compatibility mode, we want to use Linux `dirent` and `dirent64` structures in order to maintain compatibility with older libc versions that do not use the `*64` calls by default. Since the filesystems `READDIR` vop uses `dirent64`, we will convert to a `dirent` structure within the `readdir_r` call. Signed-off-by: Stefan Jumarea <stefanjumarea02@gmail.com> GitHub-Closes: unikraft#919
9089d20
to
fe58a9a
Compare
Beep boop! I ran Unikraft's
Truncated logs starting from first warning fe58a9a:
View complete logs | Learn more about Unikraft's coding style and contribution guidelines. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks a lot for your work!
Reviewed-by: Simon Kuenzer simon@unikraft.io
Approved-by: Simon Kuenzer simon@unikraft.io
Unikraft defines the `dirent` structure as identical to `dirent64`. This works fine if not using Unikraft in binary compatibility mode, since we have total control over the internal functions/structures that are used. However, if we use Unikraft in binary compatibility mode, we want to use Linux `dirent` and `dirent64` structures in order to maintain compatibility with older libc versions that do not use the `*64` calls by default. Since the filesystems `READDIR` vop uses `dirent64`, we will convert to a `dirent` structure within the `readdir_r` call. Signed-off-by: Stefan Jumarea <stefanjumarea02@gmail.com> GitHub-Closes: #919 Reviewed-by: Radu Nichita <radunichita99@gmail.com> Reviewed-by: Sergiu Moga <sergiu@unikraft.io> Reviewed-by: Simon Kuenzer <simon@unikraft.io> Approved-by: Simon Kuenzer <simon@unikraft.io> Tested-by: Unikraft CI <monkey@unikraft.io> GitHub-Closes: #963
Unikraft defines the
dirent
structure as identical todirent64
.This works fine if not using Unikraft in binary compatibility mode,
since we have total control over the internal functions/structures that
are used.
However, if we use Unikraft in binary compatibility mode, we want to use
Linux
dirent
anddirent64
structures, in order to maintain compatibilitywith older libc versions that do not use the
*64
calls by default.Since the filesystems
READDIR
vop usesdirent64
, we will convert to adirent
structure within thereaddir_r
call.You can see the issue happening in #919
In order to test it with the
app-elfloader
, you can use thels
executable from thedynamic-apps
repository, which uses an old libc version that callsgetdents
instead ofgetdents64
.Prerequisite checklist
checkpatch.uk
on your commit series before opening this PR;