From: Bastian Blank <[email protected]> Both the FIBMAP and FIGETBSZ ioctl get "int *" (pointer to 32bit integer) as argument, not "long *" as specified in qemu. Using the correct type makes the emulation work in cross endian context.
Both ioctl does not seem to be documented. However the kernel implementation has always used "int *". Signed-off-by: Bastian Blank <[email protected]> Resolves: https://gitlab.com/qemu-project/qemu/-/issues/3185 Reviewed-by: Peter Maydell <[email protected]> Reviewed-by: Helge Deller <[email protected]> Reviwed-by: Michael Tokarev <[email protected]> Signed-off-by: Michael Tokarev <[email protected]> (cherry picked from commit 7c7089321670fb51022a1c4493cbcc69aa288a0f) Signed-off-by: Michael Tokarev <[email protected]> diff --git a/linux-user/ioctls.h b/linux-user/ioctls.h index 071f7ca253..261cef1e75 100644 --- a/linux-user/ioctls.h +++ b/linux-user/ioctls.h @@ -129,13 +129,13 @@ IOCTL(FDTWADDLE, 0, TYPE_NULL) IOCTL(FDEJECT, 0, TYPE_NULL) - IOCTL(FIBMAP, IOC_W | IOC_R, MK_PTR(TYPE_LONG)) + IOCTL(FIBMAP, IOC_W | IOC_R, MK_PTR(TYPE_INT)) #ifdef FICLONE IOCTL(FICLONE, IOC_W, TYPE_INT) IOCTL(FICLONERANGE, IOC_W, MK_PTR(MK_STRUCT(STRUCT_file_clone_range))) #endif - IOCTL(FIGETBSZ, IOC_R, MK_PTR(TYPE_LONG)) + IOCTL(FIGETBSZ, IOC_R, MK_PTR(TYPE_INT)) #ifdef CONFIG_FIEMAP IOCTL_SPECIAL(FS_IOC_FIEMAP, IOC_W | IOC_R, do_ioctl_fs_ioc_fiemap, MK_PTR(MK_STRUCT(STRUCT_fiemap))) -- 2.47.3
