On Thu, 16 Oct 2025 at 13:08, Thomas Huth <[email protected]> wrote:
>
> On 10/10/2025 14.14, Peter Maydell wrote:
> > tests/tcg/multiarch/linux/linux-test.c | 9 +++++++--
> > 1 file changed, 7 insertions(+), 2 deletions(-)
> >
> > diff --git a/tests/tcg/multiarch/linux/linux-test.c
> > b/tests/tcg/multiarch/linux/linux-test.c
> > index 64f57cb287e..bf6e0fda262 100644
> > --- a/tests/tcg/multiarch/linux/linux-test.c
> > +++ b/tests/tcg/multiarch/linux/linux-test.c
> > @@ -155,9 +155,14 @@ static void test_file(void)
>
> Maybe drop the "tbuf.actime = 1001;" earlier in this file, too?
The utime("file2", &tbuf) call will still set both atime and
mtime, so we want to keep the initialization of that field
so we're not accessing an uninitialized value with the syscall.
> > error("stat mode");
> > if ((st.st_mode & 0777) != 0600)
> > error("stat mode2");
> > - if (st.st_atime != 1001 ||
> > - st.st_mtime != 1000)
> > + /*
> > + * Only check mtime, not atime: other processes such as
> > + * virus scanners might race with this test program and get
> > + * in and update the atime, causing random failures.
>
> I actually saw similar problems when looking at the atimes of the files in
> the functional test cache, so I agree, checking atime cannot work reliably.
>
> Reviewed-by: Thomas Huth <[email protected]>
thanks
-- PMM