From nobody Tue Apr 09 08:49:51 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4VDKQl2by9z5GVxG; Tue, 9 Apr 2024 08:49:51 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4VDKQl1gT6z4Y68; Tue, 9 Apr 2024 08:49:51 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1712652591; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=0vvgoWi2+vw/FFaTn1tWdOLEvg8O7CMDq3Cq3wvBAdM=; b=GQ4+sxhbRllwayPrgcm0TomYzP05OCY73t6zwHk57g3Qup8Txydo3P1+ZkZTpeZfqFpP96 slCjYCtg2+2D4BmTmAl5K/J00rTf3ql8t1R7tDSBlkLqYLxmlfamJHCPTlNgFzvwrvMMk2 eQl0PYPp+gr9/86rQ5z3sbtgBc31Nd3ONuMA8KYor31yMb6Jp3h14l9teyhYpHSdk8WdkL zSeNNVMStOxE6B1Feo3zVnaBGZoIm8NbXnluB/uzJ79d08OatVRft16lIjVD06qwCK/rZU 4/lmcUIs07f5u6bcLCfz1VLuXUISFOwtiUFf+CxrIz1E+Ly2U0i8zFDoOVzuaQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1712652591; a=rsa-sha256; cv=none; b=Ni+AeO4Nw2Fh0OL4M9epiNNAvfkG09PA4GEnBqAJeyBOTujoYWZQBj5KzDhmsKjmXwnH3Z S4iKQtE7piRWB3krSuAvPJrTY2kvGu+5LqnK6B/gppFwHNoOqgW8GLvUTM4cOL04W3zEbc CtqHSi3ANLQYMDA2go9rsBOVnix/V3dYRlQBqM6XOYxiacMO4XSrHjprV2MS7CFcUqkY5i pZBLRH8OhBPvJm52Y7Tjm7I5hlOF9Q6UkQ98y5pcr4eEVow7CbZ29jByaFsQ7Coz6YBApO WdgNtyDIULqfKe0KN+bSA2TPLGCV3TGVccxf5AXgOaIZl2n6ml07WvuPhFfHSA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1712652591; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=0vvgoWi2+vw/FFaTn1tWdOLEvg8O7CMDq3Cq3wvBAdM=; b=tLiCEFaJ2NAe7/ULxCctCHv5g3JSWwQJSi1EOd7wAs28M0J1L0nCuFyqpzpSBO7ZW77NHs 36qIJ6VulvMaWz/o+VOmhE2Bhg04CGvXUr96HlsKFHiuEKFs3Pygx2mejzSELp4pcWbJcw ItfQimeLdn085MMs8orSkaxnMjUEzQidEF31p+CVapriRu/1q17ZOERtK0BAs+1zUSMm9W tlABZ1Tc+9QcsebaK+Akf9mFmW9MlRgUv6whJ4/nHXWQtMolOPj18TqJp9lUOQ5QSQInUn XewV+FdYRVt4OO5NgP/MTG8+x77JfmCoHg7cvyF6lRnEzoJkMXzZIbqSJIm3+A== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4VDKQl19yTznRv; Tue, 9 Apr 2024 08:49:51 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 4398npcO096571; Tue, 9 Apr 2024 08:49:51 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 4398npvN096568; Tue, 9 Apr 2024 08:49:51 GMT (envelope-from git) Date: Tue, 9 Apr 2024 08:49:51 GMT Message-Id: <202404090849.4398npvN096568@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Dag-Erling =?utf-8?Q?Sm=C3=B8rgrav?= Subject: git: e069c451f85e - stable/14 - tmpfs: Improve file time tests. List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: des X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: e069c451f85e5a28f83bf4fba3b668777d2f9193 Auto-Submitted: auto-generated The branch stable/14 has been updated by des: URL: https://cgit.FreeBSD.org/src/commit/?id=e069c451f85e5a28f83bf4fba3b668777d2f9193 commit e069c451f85e5a28f83bf4fba3b668777d2f9193 Author: Dag-Erling Smørgrav AuthorDate: 2024-04-04 13:40:47 +0000 Commit: Dag-Erling Smørgrav CommitDate: 2024-04-09 08:36:04 +0000 tmpfs: Improve file time tests. * The empty test case no longer fails because 89f1dcb3eb46 causes empty files to bypass the bug. * The bug still exists, so add a test case which exercises it. * While here, tighten up some of the checks. A similar patch has been submitted upstream. PR: 274615 X-MFC-With: 89f1dcb3eb46 Sponsored by: Juniper Networks, Inc. Sponsored by: Klara, Inc. Reviewed by: markj Differential Revision: https://reviews.freebsd.org/D44609 (cherry picked from commit 8311bc5f17dec348749f763b82dfe2737bc53cd7) --- contrib/netbsd-tests/fs/tmpfs/t_times.sh | 38 +++++++++++++++++++++++++++----- 1 file changed, 32 insertions(+), 6 deletions(-) diff --git a/contrib/netbsd-tests/fs/tmpfs/t_times.sh b/contrib/netbsd-tests/fs/tmpfs/t_times.sh index f7676814fa71..2d8eb6f67aa0 100755 --- a/contrib/netbsd-tests/fs/tmpfs/t_times.sh +++ b/contrib/netbsd-tests/fs/tmpfs/t_times.sh @@ -36,10 +36,6 @@ empty_head() { atf_set "require.user" "root" } empty_body() { - # Begin FreeBSD - atf_expect_fail "Incorrect atime on FreeBSD: PR274615" - # End FreeBSD - test_mount atf_check -s eq:0 -o empty -e empty touch a @@ -49,13 +45,14 @@ empty_body() { [ ${ost_birthtime} -eq ${ost_mtime} ] || atf_fail "Incorrect mtime" sleep 1 - atf_check -s eq:0 -o ignore -e empty cat a + atf_check -s eq:0 -o empty -e empty cat a eval $(stat -s a) || atf_fail "stat failed" [ ${st_atime} -gt ${ost_atime} ] || atf_fail "Incorrect atime" [ ${st_ctime} -eq ${ost_ctime} ] || atf_fail "Incorrect ctime" [ ${st_mtime} -eq ${ost_mtime} ] || atf_fail "Incorrect mtime" sleep 1 + ost_atime=${st_atime} echo foo >a || atf_fail "Write failed" eval $(stat -s a) || atf_fail "stat failed" [ ${st_atime} -gt ${ost_atime} ] || atf_fail "Incorrect atime" @@ -65,6 +62,34 @@ empty_body() { test_unmount } +atf_test_case holey +holey_head() { + atf_set "descr" "Tests that creating a file consisting entirely" \ + "of a hole and later" \ + "manipulating it updates times correctly" + atf_set "require.user" "root" +} +holey_body() { + atf_expect_fail "https://bugs.freebsd.org/274615" + + test_mount + + atf_check -s eq:0 -o empty -e empty truncate -s 8k a + eval $(stat -s a | sed -e 's|st_|ost_|g') || atf_fail "stat failed" + [ ${ost_birthtime} -eq ${ost_atime} ] || atf_fail "Incorrect atime" + [ ${ost_birthtime} -eq ${ost_ctime} ] || atf_fail "Incorrect ctime" + [ ${ost_birthtime} -eq ${ost_mtime} ] || atf_fail "Incorrect mtime" + + sleep 1 + atf_check -s eq:0 -o ignore -e empty cat a + eval $(stat -s a) || atf_fail "stat failed" + [ ${st_atime} -gt ${ost_atime} ] || atf_fail "Incorrect atime" + [ ${st_ctime} -eq ${ost_ctime} ] || atf_fail "Incorrect ctime" + [ ${st_mtime} -eq ${ost_mtime} ] || atf_fail "Incorrect mtime" + + test_unmount +} + atf_test_case non_empty non_empty_head() { atf_set "descr" "Tests that creating a non-empty file and later" \ @@ -78,7 +103,7 @@ non_empty_body() { eval $(stat -s b | sed -e 's|st_|ost_|g') || atf_fail "stat failed" sleep 1 - atf_check -s eq:0 -o ignore -e empty cat b + atf_check -s eq:0 -o inline:"foo\n" -e empty cat b eval $(stat -s b) || atf_fail "stat failed" [ ${st_atime} -gt ${ost_atime} ] || atf_fail "Incorrect atime" [ ${st_ctime} -eq ${ost_ctime} ] || atf_fail "Incorrect ctime" @@ -139,6 +164,7 @@ atf_init_test_cases() { . $(atf_get_srcdir)/h_funcs.subr atf_add_test_case empty + atf_add_test_case holey atf_add_test_case non_empty atf_add_test_case link atf_add_test_case rename