• Arnd Bergmann's avatar
    sh: rework sync_file_range ABI · 30766f11
    Arnd Bergmann authored
    The unusual function calling conventions on SuperH ended up causing
    sync_file_range to have the wrong argument order, with the 'flags'
    argument getting sorted before 'nbytes' by the compiler.
    
    In userspace, I found that musl, glibc, uclibc and strace all expect the
    normal calling conventions with 'nbytes' last, so changing the kernel
    to match them should make all of those work.
    
    In order to be able to also fix libc implementations to work with existing
    kernels, they need to be able to tell which ABI is used. An easy way
    to do this is to add yet another system call using the sync_file_range2
    ABI that works the same on all architectures.
    
    Old user binaries can now work on new kernels, and new binaries can
    try the new sync_file_range2() to work with new kernels or fall back
    to the old sync_file_range() version if that doesn't exist.
    
    Cc: stable@vger.kernel.org
    Fixes: 75c92acd ("sh: Wire up new syscalls.")
    Acked-by: default avatarJohn Paul Adrian Glaubitz <glaubitz@physik.fu-berlin.de>
    Signed-off-by: default avatarArnd Bergmann <arnd@arndb.de>
    30766f11
syscall.tbl 16.7 KB