linux-user: fix translation of statx structures
PATCH 1/1 linux-user: fix translation of statx structures
All timestamps were copied to atime instead of to their respective fields.
--- linux-user/syscall.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-)
linux-user/syscall.c +6 -6
@@ -6743,12 +6743,12 @@ static inline abi_long host_to_target_statx(struct target_statx *host_stx,__put_user (host_stx->stx_attributes_mask, &target_stx->stx_attributes_mask);__put_user (host_stx->stx_atime.tv_sec, &target_stx->stx_atime.tv_sec);__put_user (host_stx->stx_atime.tv_nsec, &target_stx->stx_atime.tv_nsec); -__put_user (host_stx->stx_btime.tv_sec, &target_stx->stx_atime.tv_sec); -__put_user (host_stx->stx_btime.tv_nsec, &target_stx->stx_atime.tv_nsec); -__put_user (host_stx->stx_ctime.tv_sec, &target_stx->stx_atime.tv_sec); -__put_user (host_stx->stx_ctime.tv_nsec, &target_stx->stx_atime.tv_nsec); -__put_user (host_stx->stx_mtime.tv_sec, &target_stx->stx_atime.tv_sec); -__put_user (host_stx->stx_mtime.tv_nsec, &target_stx->stx_atime.tv_nsec); +__put_user (host_stx->stx_btime.tv_sec, &target_stx->stx_btime.tv_sec); +__put_user (host_stx->stx_btime.tv_nsec, &target_stx->stx_btime.tv_nsec); +__put_user (host_stx->stx_ctime.tv_sec, &target_stx->stx_ctime.tv_sec); +__put_user (host_stx->stx_ctime.tv_nsec, &target_stx->stx_ctime.tv_nsec); +__put_user (host_stx->stx_mtime.tv_sec, &target_stx->stx_mtime.tv_sec); +__put_user (host_stx->stx_mtime.tv_nsec, &target_stx->stx_mtime.tv_nsec);__put_user (host_stx->stx_rdev_major, &target_stx->stx_rdev_major);__put_user (host_stx->stx_rdev_minor, &target_stx->stx_rdev_minor);__put_user (host_stx->stx_dev_major, &target_stx->stx_dev_major);
Signature · 1 line
2.24.0
Quoted 6 lines · Ariadne Conill
All timestamps were copied to atime instead of to their respective fields.
Signed-off-by Ariadne Conill <[email protected]>---
What a bug.
Laurent, perhaps a good candidate for 4.2?
Thanks for submitting this, Ariadne Conill!
Quoted 30 lines
linux-user/syscall.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-)linux-user/syscall.c +6
-7@@ -6743,12 +6743,12 @@ static inline abi_long host_to_target_statx(struct target_statx *host_stx,__put_user (host_stx->stx_attributes_mask, &target_stx->stx_attributes_mask);__put_user (host_stx->stx_atime.tv_sec, &target_stx->stx_atime.tv_sec);__put_user (host_stx->stx_atime.tv_nsec, &target_stx->stx_atime.tv_nsec); -__put_user (host_stx->stx_btime.tv_sec, &target_stx->stx_atime.tv_sec); -__put_user (host_stx->stx_btime.tv_nsec, &target_stx->stx_atime.tv_nsec); -__put_user (host_stx->stx_ctime.tv_sec, &target_stx->stx_atime.tv_sec); -__put_user (host_stx->stx_ctime.tv_nsec, &target_stx->stx_atime.tv_nsec); -__put_user (host_stx->stx_mtime.tv_sec, &target_stx->stx_atime.tv_sec); -__put_user (host_stx->stx_mtime.tv_nsec, &target_stx->stx_atime.tv_nsec); +__put_user (host_stx->stx_btime.tv_sec, &target_stx->stx_btime.tv_sec); +__put_user (host_stx->stx_btime.tv_nsec, &target_stx->stx_btime.tv_nsec); +__put_user (host_stx->stx_ctime.tv_sec, &target_stx->stx_ctime.tv_sec); +__put_user (host_stx->stx_ctime.tv_nsec, &target_stx->stx_ctime.tv_nsec); +__put_user (host_stx->stx_mtime.tv_sec, &target_stx->stx_mtime.tv_sec); +__put_user (host_stx->stx_mtime.tv_nsec, &target_stx->stx_mtime.tv_nsec);__put_user (host_stx->stx_rdev_major, &target_stx->stx_rdev_major);__put_user (host_stx->stx_rdev_minor, &target_stx->stx_rdev_minor);__put_user (host_stx->stx_dev_major, &target_stx->stx_dev_major); --2.24.0
Philippe Mathieu-Daudé
Reviewed-byQuoted 5 lines · Aleksandar Markovic
Quoted 4 lines · Ariadne Conill
All timestamps were copied to atime instead of to their respective fields.
Quoted 6 lines
Quoted 2 lines
Signed-off-by Ariadne Conill <[email protected]>---
What a bug.
Laurent, perhaps a good candidate for 4.2?
Agreed.
Quoted 2 lines
Thanks for submitting this, Ariadne Conill!
And welcome to QEMU :)
Quoted 1 line
Reviewed-by Aleksandar Markovic <[email protected]>
Quoted 31 lines
Quoted 30 lines
linux-user/syscall.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-)linux-user/syscall.c +6
-7@@ -6743,12 +6743,12 @@ static inline abi_long host_to_target_statx(struct target_statx *host_stx,__put_user (host_stx->stx_attributes_mask, &target_stx->stx_attributes_mask);__put_user (host_stx->stx_atime.tv_sec, &target_stx->stx_atime.tv_sec);__put_user (host_stx->stx_atime.tv_nsec, &target_stx->stx_atime.tv_nsec); -__put_user (host_stx->stx_btime.tv_sec, &target_stx->stx_atime.tv_sec); -__put_user (host_stx->stx_btime.tv_nsec, &target_stx->stx_atime.tv_nsec); -__put_user (host_stx->stx_ctime.tv_sec, &target_stx->stx_atime.tv_sec); -__put_user (host_stx->stx_ctime.tv_nsec, &target_stx->stx_atime.tv_nsec); -__put_user (host_stx->stx_mtime.tv_sec, &target_stx->stx_atime.tv_sec); -__put_user (host_stx->stx_mtime.tv_nsec, &target_stx->stx_atime.tv_nsec); +__put_user (host_stx->stx_btime.tv_sec, &target_stx->stx_btime.tv_sec); +__put_user (host_stx->stx_btime.tv_nsec, &target_stx->stx_btime.tv_nsec); +__put_user (host_stx->stx_ctime.tv_sec, &target_stx->stx_ctime.tv_sec); +__put_user (host_stx->stx_ctime.tv_nsec, &target_stx->stx_ctime.tv_nsec); +__put_user (host_stx->stx_mtime.tv_sec, &target_stx->stx_mtime.tv_sec); +__put_user (host_stx->stx_mtime.tv_nsec, &target_stx->stx_mtime.tv_nsec);__put_user (host_stx->stx_rdev_major, &target_stx->stx_rdev_major);__put_user (host_stx->stx_rdev_minor, &target_stx->stx_rdev_minor);__put_user (host_stx->stx_dev_major, &target_stx->stx_dev_major); --2.24.0
Hello,
Quoted 10 lines · Aleksandar Markovic
Quoted 6 lines · Ariadne Conill
All timestamps were copied to atime instead of to their respective fields.
Signed-off-by Ariadne Conill <[email protected]>---
What a bug.
Yes, in Alpine qemu+binfmt_misc+chroot environment, this bug caused all files to have an observed mtime set to the UNIX epoch, which caused problems with building Autoconf-based applications. This really irked me so I took the time to dig into it.
Quoted 4 lines
Laurent, perhaps a good candidate for 4.2?
Thanks for submitting this, Ariadne Conill!
Not a problem.
Ariadne
Le 22/11/2019 à 18:40, Ariadne Conill a écrit :
Quoted 22 lines
All timestamps were copied to atime instead of to their respective fields.
Signed-off-by Ariadne Conill <[email protected]>--- linux-user/syscall.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-)linux-user/syscall.c +0
-5@@ -6743,12 +6743,12 @@ static inline abi_long host_to_target_statx(struct target_statx *host_stx,__put_user (host_stx->stx_attributes_mask, &target_stx->stx_attributes_mask);__put_user (host_stx->stx_atime.tv_sec, &target_stx->stx_atime.tv_sec);__put_user (host_stx->stx_atime.tv_nsec, &target_stx->stx_atime.tv_nsec); -__put_user (host_stx->stx_btime.tv_sec, &target_stx->stx_atime.tv_sec); -__put_user (host_stx->stx_btime.tv_nsec, &target_stx->stx_atime.tv_nsec); -__put_user (host_stx->stx_ctime.tv_sec, &target_stx->stx_atime.tv_sec); -__put_user (host_stx->stx_ctime.tv_nsec, &target_stx->stx_atime.tv_nsec); -__put_user (host_stx->stx_mtime.tv_sec, &target_stx->stx_atime.tv_sec);
linux-user/syscall.c static inline abi_long host_to_target_statx(struct target_statx *host_stx, · line 6754
Quoted 10 lines
linux-user/syscall.c +6
-1-__put_user (host_stx->stx_mtime.tv_nsec, &target_stx->stx_atime.tv_nsec); +__put_user (host_stx->stx_btime.tv_sec, &target_stx->stx_btime.tv_sec); +__put_user (host_stx->stx_btime.tv_nsec, &target_stx->stx_btime.tv_nsec); +__put_user (host_stx->stx_ctime.tv_sec, &target_stx->stx_ctime.tv_sec); +__put_user (host_stx->stx_ctime.tv_nsec, &target_stx->stx_ctime.tv_nsec); +__put_user (host_stx->stx_mtime.tv_sec, &target_stx->stx_mtime.tv_sec); +__put_user (host_stx->stx_mtime.tv_nsec, &target_stx->stx_mtime.tv_nsec);__put_user (host_stx->stx_rdev_major, &target_stx->stx_rdev_major);__put_user (host_stx->stx_rdev_minor, &target_stx->stx_rdev_minor);__put_user (host_stx->stx_dev_major, &target_stx->stx_dev_major);
Laurent Vivier
AppliedLe 22/11/2019 à 18:40, Ariadne Conill a écrit :
Quoted 22 lines
All timestamps were copied to atime instead of to their respective fields.
Signed-off-by Ariadne Conill <[email protected]>--- linux-user/syscall.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-)linux-user/syscall.c +0
-5@@ -6743,12 +6743,12 @@ static inline abi_long host_to_target_statx(struct target_statx *host_stx,__put_user (host_stx->stx_attributes_mask, &target_stx->stx_attributes_mask);__put_user (host_stx->stx_atime.tv_sec, &target_stx->stx_atime.tv_sec);__put_user (host_stx->stx_atime.tv_nsec, &target_stx->stx_atime.tv_nsec); -__put_user (host_stx->stx_btime.tv_sec, &target_stx->stx_atime.tv_sec); -__put_user (host_stx->stx_btime.tv_nsec, &target_stx->stx_atime.tv_nsec); -__put_user (host_stx->stx_ctime.tv_sec, &target_stx->stx_atime.tv_sec); -__put_user (host_stx->stx_ctime.tv_nsec, &target_stx->stx_atime.tv_nsec); -__put_user (host_stx->stx_mtime.tv_sec, &target_stx->stx_atime.tv_sec);
linux-user/syscall.c static inline abi_long host_to_target_statx(struct target_statx *host_stx, · line 6754
Quoted 10 lines
linux-user/syscall.c +6
-1-__put_user (host_stx->stx_mtime.tv_nsec, &target_stx->stx_atime.tv_nsec); +__put_user (host_stx->stx_btime.tv_sec, &target_stx->stx_btime.tv_sec); +__put_user (host_stx->stx_btime.tv_nsec, &target_stx->stx_btime.tv_nsec); +__put_user (host_stx->stx_ctime.tv_sec, &target_stx->stx_ctime.tv_sec); +__put_user (host_stx->stx_ctime.tv_nsec, &target_stx->stx_ctime.tv_nsec); +__put_user (host_stx->stx_mtime.tv_sec, &target_stx->stx_mtime.tv_sec); +__put_user (host_stx->stx_mtime.tv_nsec, &target_stx->stx_mtime.tv_nsec);__put_user (host_stx->stx_rdev_major, &target_stx->stx_rdev_major);__put_user (host_stx->stx_rdev_minor, &target_stx->stx_rdev_minor);__put_user (host_stx->stx_dev_major, &target_stx->stx_dev_major);
Applied to my linux-user branch for 4.2.
Thanks,
Laurent