linux-user: fix fallocate
PATCH 1/1 linux-user: fix fallocate
Fallocate gets off_t parameters passed in, so we should also read them out accordingly.
--- linux-user/syscall.c | 3 ++- 1 files changed, 2 insertions(+), 1 deletions(-)
linux-user/syscall.c +2 -1
@@ -8237,7 +8237,8 @@ abi_long do_syscall(void *cpu_env, int num, abi_long arg1,#endif /* CONFIG_EVENTFD */ #if defined(CONFIG_FALLOCATE ) && defined(TARGET_NR_fallocate)case TARGET_NR_fallocate: - ret =get_errno (fallocate (arg1, arg2, arg3, arg4)); + ret =get_errno (fallocate (arg1, arg2,target_offset64 (arg3, arg4), +target_offset64 (arg5, arg6)));break ;#endif #if defined(CONFIG_SYNC_FILE_RANGE )
Signature · 1 line
1.6.0.2
Quoted 15 lines · Alexander Graf
Fallocate gets
off_tparameters passed in, so we should also read them out accordingly.Signed-off-by Alexander Graf <[email protected]>---
linux-user/syscall.c | 3 ++-1 files changed, 2 insertions(+), 1 deletions(-)linux-user/syscall.c +0
-0@@ -8237,7 +8237,8 @@ abi_long do_syscall(void *cpu_env, int num, abi_long arg1, #endif /* CONFIG_EVENTFD */ #if defined(CONFIG_FALLOCATE) && defined(TARGET_NR_fallocate)
Quoted 7 lines
case
TARGET_NR_fallocate:
- ret =get_errno(fallocate(arg1, arg2, arg3, arg4));
+ ret = get_errno(fallocate(arg1, arg2,target_offset64(arg3, arg4),
+ target_offset64(arg5, arg6))); break;
#endif
#ifdefined(CONFIG_SYNC_FILE_RANGE)
This needs to be guarded with a TARGET_ABI_BITS == 32 conditional:
64 bit guests want the original version.
-- PMM
Quoted 18 lines · Peter Maydell
Quoted 17 lines · Alexander Graf
Fallocate gets
off_tparameters passed in, so we should also read them out accordingly.Signed-off-by Alexander Graf <[email protected]>--- linux-user/syscall.c | 3 ++- 1 files changed, 2 insertions(+), 1 deletions(-)linux-user/syscall.c +0
-1@@ -8237,7 +8237,8 @@ abi_long do_syscall(void *cpu_env, int num, abi_long arg1,#endif /* CONFIG_EVENTFD */ #if defined(CONFIG_FALLOCATE ) && defined(TARGET_NR_fallocate)case TARGET_NR_fallocate: - ret =get_errno (fallocate (arg1, arg2, arg3, arg4));
Quoted 8 lines
linux-user/syscall.c abi_long do_syscall(void *cpu_env, int num, abi_long arg1, · line 8244
Quoted 5 lines
linux-user/syscall.c +2
-0+ ret =get_errno (fallocate (arg1, arg2,target_offset64 (arg3, arg4), +target_offset64 (arg5, arg6)));break ;#endif #if defined(CONFIG_SYNC_FILE_RANGE )This needs to be guarded with a
TARGET_ABI_BITS== 32 conditional:
64 bit guests want the original version.
Good point. Thanks!
Alex