-
Notifications
You must be signed in to change notification settings - Fork 18k
syscall, x/sys/unix: wrong order of arguments for SyncFileRange on linux/ppc64{,le} #27485
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
Comments
Also see https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=edd5cd4a9424f22b0fa08bef5e299d41befd5622 for the reasoning for there being two syscalls. |
The implementation on |
Change https://golang.org/cl/133195 mentions this issue: |
Change https://golang.org/cl/133215 mentions this issue: |
…c64{,le} On linux/ppc64{,le} the SYS_SYNC_FILE_RANGE2 syscall is used to implement SyncFileRange. This syscall has a different argument order than SYS_SYNC_FILE_RANGE. Apart from that the implementations of both syscalls are the same, so use a simple wrapper to invoke the syscall with the correct argument order. For context see: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=edd5cd4a9424f22b0fa08bef5e299d41befd5622 Updates #27485 Change-Id: Ib94fb98376bf6c879df6f1b68c3bdd11ebcb5a44 Reviewed-on: https://go-review.googlesource.com/133195 Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
While investigating what was wrong with https://golang.org/cl/133015 (see #27475), I noticed that the order of the syscall arguments in the SyncFileRange implementation is wrong for
ppc64
andppc64le
. They use theSYS_SYNC_FILE_RANGE2
syscall which is defined as:https://github.com/torvalds/linux/blob/60c1f89241d49bacf71035470684a8d7b4bb46ea/fs/sync.c#L371-L375
while
SYS_SYNC_FILE_RANGE
used by all otherGOARCH
es is defined as:https://github.com/torvalds/linux/blob/60c1f89241d49bacf71035470684a8d7b4bb46ea/fs/sync.c#L363-L367
Note the different position of the
flags
argument. This should be fixed by using appropriate wrappers onlinux/ppc64{,le}
./cc @bradfitz @ianlancetaylor
The text was updated successfully, but these errors were encountered: