From nobody Fri Nov 14 19:39:59 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1760957066; cv=none; d=zohomail.com; s=zohoarc; b=gimuU9oE+/ZTdHc1sk1Bdc+tmQ4IUEwczV1r4HM6LvoKDICJYsKQdQJ5zVjrfxMUMLfqgYs9JwRodAuh/0S8rWefCTdA+ovuBr5jIH/K0uQzEDCkK8RcJ/EgL2MBGt8BmLzuGkPCLVX7Se6ukxtwny030I0lJQZ755f39HImx3Y= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1760957066; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=pdpnkMbbUpYrtLpkGWrMXiavm+tcMRwuxpmilKnsCCA=; b=dgZ+dEEGF+UPs5ts7eZcdbMgKY03KSc19OHGuAYjUrggn6snIoPaNYrxE8SLqTYZL7DhwiyoxUNuSC2OSLNHyJQKjUBTfK9OPjPDLkuiO1HjyBygZ9KFBYD3PH9Dmd35X7qS6piABNsAG5Qsuw9c9GOMSU9LQ84pnMHSr71xZ6c= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1760957066959905.9946090965799; Mon, 20 Oct 2025 03:44:26 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vAnL0-0007ZS-3b; Mon, 20 Oct 2025 06:42:02 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1vAnKv-0007WO-Dz for qemu-devel@nongnu.org; Mon, 20 Oct 2025 06:41:57 -0400 Received: from mail-ej1-x62e.google.com ([2a00:1450:4864:20::62e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1vAnKt-0000g1-BF for qemu-devel@nongnu.org; Mon, 20 Oct 2025 06:41:57 -0400 Received: by mail-ej1-x62e.google.com with SMTP id a640c23a62f3a-b3b3a6f4dd4so781890666b.0 for ; Mon, 20 Oct 2025 03:41:54 -0700 (PDT) Received: from draig.lan ([185.126.160.19]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-b65e83937a3sm757643366b.23.2025.10.20.03.41.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 20 Oct 2025 03:41:50 -0700 (PDT) Received: from draig.lan (localhost [IPv6:::1]) by draig.lan (Postfix) with ESMTP id D67445F905; Mon, 20 Oct 2025 11:41:49 +0100 (BST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1760956913; x=1761561713; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=pdpnkMbbUpYrtLpkGWrMXiavm+tcMRwuxpmilKnsCCA=; b=Kb98qTObo78LlPgezIQ+zQFQLHFBtFAYShB/+IR4OKK5dV7crAwkVlf7FqNyrDlDTZ i0agl9YSScPSEog1H8SqgSJRTsnR6bVHXM1Cg13h7k504EOUKpJ0Q8JmWvaN/JvRIpq1 okuSKTcRMWHCid9x9EGNpaHK2+Kgc59nw1heduZGqsOcs/WsGx3L6gfjADuTxfcMrx9s 8zs8HY/ExstZzUIU28PidqNvNsQiDacnq0N+W/mjoaRTnXXwDrrqg9IKNT1PsgrZXTeT PLElMOeX3TcRrJnVEqMWVdf3ZNEgN948VcOSrwQ9VnhLxUxIB549qlhVVRnIzBVBBGa7 rRQw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1760956913; x=1761561713; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=pdpnkMbbUpYrtLpkGWrMXiavm+tcMRwuxpmilKnsCCA=; b=QJ1uq+K9vQZtwiG6EjUf2P7/DwPGrjYvVMqJRoUeyFUqO8NnOJF0X292cknyt9BKFq IoEco47TChwFee+Ufku1WW2h9iNwy5QXuMMVofxaBeifHlDtWdODRupqTKuoZxqqKpNQ k0Ob+ATzZRQ6zUNVkW/icWKVxsJTL8fExID1WtWBEfWo1YsMoeVIDuEMrorac9UVyfo+ iccRarfSBfJdILrIlnjHfVooJwNhEYfwdaumXdNK1JmXChg1F+2uVOjQKTcT6VPa9O+W xgq4oDPu0HAm7JKgbtZN4+pHdS0D4Cd9eZh/cQYuRA5hl4ydqikP+6Z+izfsNK+8mi9z Qo+g== X-Gm-Message-State: AOJu0Yw/1poSozjcZziaDnHnZqTYaT/5NTym9dlf2KfCKLrt4Em+SFpg kamOoD2tFm60HzVc2Zvtx+tHhmcx6hFV0UQQRsPew4/2DFueRcSzp6GC2eTctriNa8ZsvL88H4f IeMP4af0= X-Gm-Gg: ASbGncu3FFiO4pUjA+lkVwBnmwW+lhFifsegCvBDwSDr2xvB0JF3StgtzrGukN27xnw pVZQlWRQjKPCizySAP0ajMPV0vDd4OqEM+7jNgfwsKyt5im/hWArWA6zikoxtuX/+AzT4mpIpgt kXJnKP6uEs9zxWQLzK+3ApoeLolaPgCpv5ADVfkQ6gwiU0fFoMkEjgV56WRLusaHra7yukGZXN+ Guts4LCKeLLOBNeCmzvOckUDABoVegnzv1J5J2s0IVz3se8gozqFdh0WjGksX0G2ab1lqW0P8/u 7wTGKFQ+wA6iWDZHLjjlQ6yOLp+Qi/9/hhxJWOu8QmZtsnzVYCsUHI5j7f+KRhMdkTSD6Cvk4yZ d1A5Z1H1IhptVy4TeVZnXTzgIs2IXPgeac6DsJbIhesFNcU4YcJLvvMZLS3I19068kqoHySW3PX kzqeYo8LFj+38= X-Google-Smtp-Source: AGHT+IGPcKbhjk7sTWmD13E2n3JKvkcNRO1Xsan0ivp9dCNie+2dSpUFEnn2P87sh/KlCc/t5vRfxw== X-Received: by 2002:a17:907:7b87:b0:b2d:d7ba:8e7b with SMTP id a640c23a62f3a-b647463a2d7mr1457036366b.23.1760956913116; Mon, 20 Oct 2025 03:41:53 -0700 (PDT) From: =?UTF-8?q?Alex=20Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: Peter Maydell , qemu-stable@nongnu.org, Thomas Huth , Richard Henderson , =?UTF-8?q?Alex=20Benn=C3=A9e?= Subject: [PULL 03/11] tests/tcg/multiarch/linux/linux-test: Don't try to test atime update Date: Mon, 20 Oct 2025 11:41:41 +0100 Message-ID: <20251020104149.4034124-4-alex.bennee@linaro.org> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20251020104149.4034124-1-alex.bennee@linaro.org> References: <20251020104149.4034124-1-alex.bennee@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::62e; envelope-from=alex.bennee@linaro.org; helo=mail-ej1-x62e.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1760957067668154100 From: Peter Maydell The linux-test test includes an attempt to check the utime and stat syscalls by setting the atime and mtime of a file to specific values, and then calling stat() to check that the values read back correctly. Unfortunately this is flaky, as it will fail if some other process (for instance a virus scanner, backup program, etc) gets in and reads the file between the utime() and stat() call, resulting in a host syscall sequence like this: utimensat(AT_FDCWD, "file2", [{tv_sec=3D1001, tv_nsec=3D0} /* 1970-01-01T01:16:41+0100 */, {tv_sec=3D1000, tv_nsec=3D0} /* 1970-01-01T01:16:40+0100 */], 0) =3D 0 # successfully set atime to 1001 and mtime to 1000 statx(AT_FDCWD, "file2", AT_STATX_SYNC_AS_STAT|AT_NO_AUTOMOUNT, STATX_BASIC_STATS, {stx_mask=3DSTATX_BASIC_STATS|STATX_MNT_ID, stx_blksize=3D4096, stx_attributes=3D0, stx_nlink=3D1, stx_uid=3D32808, stx_gid=3D32808, stx_mode=3DS_IFREG|0600, stx_ino=3D21659016, stx_size=3D100, stx_blocks=3D8, stx_attributes_mask=3DSTATX_ATTR_COMPRESSED|STATX_ATTR_IMMUTABLE| STATX_ATTR_APPEND|STATX_ATTR_NODUMP|STATX_ATTR_ENCRYPTED| STATX_ATTR_AUTOMOUNT|STATX_ATTR_MOUNT_ROOT|STATX_ATTR_VERITY| STATX_ATTR_DAX, stx_atime=3D{tv_sec=3D1760091862, tv_nsec=3D63509009} /* 2025-10-10T11:2= 4:22.063509009+0100 */, stx_ctime=3D{tv_sec=3D1760091862, tv_nsec=3D63509009} /* 2025-10-10T11:2= 4:22.063509009+0100 */, stx_mtime=3D{tv_sec=3D1000, tv_nsec=3D0} /* 1970-01-01T01:16:40+0100 */, stx_rdev_major=3D0, stx_rdev_minor=3D0, stx_dev_major=3D252, stx_dev_minor=3D0, stx_mnt_id=3D0x1f}) =3D 0 # but when we statx the file, we get back an mtime of 1000 # but an atime corresponding to when the other process read it and which will cause the test program to fail with the error message "stat time". In theory we could defend against this by e.g. operating on files in a dummy loopback mount filesystem which we mounted as 'noatime', but this isn't worth the hassle. Just drop the check on atime. Cc: qemu-stable@nongnu.org Signed-off-by: Peter Maydell Reviewed-by: Thomas Huth Reviewed-by: Richard Henderson Message-ID: <20251016150357.876415-4-alex.bennee@linaro.org> Signed-off-by: Alex Benn=C3=A9e diff --git a/tests/tcg/multiarch/linux/linux-test.c b/tests/tcg/multiarch/l= inux/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) error("stat mode"); if ((st.st_mode & 0777) !=3D 0600) error("stat mode2"); - if (st.st_atime !=3D 1001 || - st.st_mtime !=3D 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. + */ + if (st.st_mtime !=3D 1000) { error("stat time"); + } =20 chk_error(stat(tmpdir, &st)); if (!S_ISDIR(st.st_mode)) --=20 2.47.3