-
Notifications
You must be signed in to change notification settings - Fork 17.8k
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
syscall: wrong Dirent struct on mips64le #23624
Comments
CC @minux @cherrymui |
PS: I believe this only affects people who parse the |
We should probably move to use getdents64 on MIPS64, just like all other architectures. At the time the code was written, getdents64 was rather new in MIPS64 Linux kernel. But it is not new anymore, and we probably do require newer kernels. |
|
I would certainly encourage anybody who wants to call |
Yeah, I think we can fix this (with a api-breaking change) now as 3.10 is
almost 6 years old.
I do think the syscall package should at least work for the most basic
things (e.g. not supporting bpf is fine, but Getdirent should work.)
|
According to https://github.com/golang/go/wiki/MinimumRequirements the minimum kernel version required for linux/mips64le is 4.8, so that shouldn't be a problem. |
Change https://golang.org/cl/91055 mentions this issue: |
On mips64le, syscall.Getdents() and struct syscall.Dirent do not fit together, causing our Getdents implementation to return garbage ( #200 and golang/go#23624 ). Switch to unix.Getdents which does not have this problem - the next Go release with the syscall package fixes is too far away, and will take time to trickle into distros.
Hi, we use |
@lechner, |
@lechner, whatever the Go-Fuse authors are using is fine, if their code is working. If they hit problems and they're using |
@bradfitz Thank you! |
On mips64le, syscall.Getdents() and struct syscall.Dirent do not fit together, causing our parseDirents() implementation to return garbage ( see rfjakob/gocryptfs#200 and golang/go#23624 ). Switch to unix.Getdents which does not have this problem - the next Go release with the syscall package fixes is too far away, and will take time to trickle into distros.
On mips64le, syscall.Getdents() and struct syscall.Dirent do not fit together, causing our parseDirents() implementation to return garbage ( see rfjakob/gocryptfs#200 and golang/go#23624 ). Switch to unix.Getdents which does not have this problem - the next Go release with the syscall package fixes is too far away, and will take time to trickle into distros. This issue has been reported by Debian maintainer Felix Lechner.
On mips64le, syscall.Getdents() and struct syscall.Dirent do not fit together, causing our parseDirents() implementation to return garbage ( see rfjakob/gocryptfs#200 and golang/go#23624 ). Switch to unix.Getdents which does not have this problem - the next Go release with the syscall package fixes is too far away, and will take time to trickle into distros. This issue has been reported by Debian maintainer Felix Lechner.
The maintainer of the Debian package just reported that gocryptfs is broken on mips64le: rfjakob/gocryptfs#200 . The reason seems to be that
syscall.Dirent
does not match the usedgetdents
syscall. Analysis below:On mips64le,
getdents
is used instead ofgetdents64
:go/src/syscall/syscall_linux_mips64x.go
Line 13 in bcc86d5
And
getdents
returnslinux_dirent
, which defined in https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/fs/readdir.c?h=v4.15#n147 :In Go mips64le, syscall.Dirent is defined here
go/src/syscall/ztypes_linux_mips64le.go
Line 133 in bcc86d5
And this looks wrong, because it has a
Type
field, which the thelinux_dirent
struct has not.The text was updated successfully, but these errors were encountered: