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 and ppc64le. They use the SYS_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 other GOARCHes 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 on linux/ppc64{,le}.
/cc @bradfitz @ianlancetaylor