From nobody Thu Apr 04 13:41:15 2024 X-Original-To: dev-commits-src-main@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 4V9N7H60pzz5H2cM; Thu, 4 Apr 2024 13:41:15 +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 4V9N7H5BvQz4CM4; Thu, 4 Apr 2024 13:41:15 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1712238075; 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=KIkQF8KPcdOrew22xJ5DCqDEhgIuevHLIWxIUtedsfo=; b=g9QaLdC7RFzO6+xaXRUjThR7wgiXr0a7MxVoUuKSvYOCisLPLFEeZYbSb9Hlq9Bby5T0ij rHS7KT1cShvcjo7PZRssp7Mas9SJGljomBqvFfwz5VkT6XVGur82pa0ZcbGjfbKTMg/GE8 s0l3TpHZhEkyHr/9dsQ/7E0fZHCf9asZ2u7IsC1AHIi0Qmi//Py0wc2W/aVWzIHiQGxSwT GIHIaljj6vpwy14Tt3wqdOCCBA4qVzbHo2aWHRY/hRHUsVTgdI7hIcXZk13I/GyKl5dCBD W1M80Wyj1l6TPiWp9X6Ypi5HO0kCH6cOaJXWF5CXZqwcDTdEzU8lrN5C8EW+cw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1712238075; a=rsa-sha256; cv=none; b=YCa+V/y/EPOcwQ8kP1s4cyvqMA7ED0P8JZhGYlPW1vZv6hutmrdcPaRlospTcfiQmEkaG3 R2v3W3BKVQwI5iSMoIr11yDBSlroESEntM+vmoGPkbUCV0k4IhmyzBqEV7iGzZRDrJYp3P Y/EsF7lYtaqapevxLZWEB9e+q2b6KmXOe4QteqpYkYR/pqY9UaROewfnY3Nsj56f6y+kw5 9BpUAsiVeBpXSCehuoPKpgp+2g/WJrBVugVnLGpF8dwAbeOdY9Y3p3xeoQkwelv3W2bh2D YQHVvh72ONjfIeKPE1rLkuNW0WcZ9sopLLCmNNl2FEeNfCFzlvY9txwSJeeTfA== 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=1712238075; 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=KIkQF8KPcdOrew22xJ5DCqDEhgIuevHLIWxIUtedsfo=; b=sMSRXaHmJOrkfCQhKoFa3bFYGkQL9KKUvQ754ZjPvjlOOmnzxqU0/LypD1JHbyB7NYjhbC XHp+2ViRpXgqrVwpv1Ym24pkvc9vBp/thOxoLqYIH/o7k6SulFjE/Lh6LgNHAVO9wokLNZ W4K+tihCBY1Eo/mRQKPfdb6dcXjkrrIBYaTqx+5a/gjwe933w2nGo/rX6aE7oXvgeAqGZn 2Z1bREpJ9OEhFBEY5RplDX2lHc5ZuxgPsMq1dCiBHcXAEFFQlW6Wl8iXEupW+3nbIwQGp9 /Szh9bx40VTJUSJEsWMymyILXacdciMyrVebTjAVuTekkbAvHmApCadyoTW67g== 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 4V9N7H4q5tzJTh; Thu, 4 Apr 2024 13:41:15 +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 434DfFPP077585; Thu, 4 Apr 2024 13:41:15 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 434DfFZs077582; Thu, 4 Apr 2024 13:41:15 GMT (envelope-from git) Date: Thu, 4 Apr 2024 13:41:15 GMT Message-Id: <202404041341.434DfFZs077582@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Dag-Erling =?utf-8?Q?Sm=C3=B8rgrav?= Subject: git: 8311bc5f17de - main - tmpfs: Improve file time tests. List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@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/main X-Git-Reftype: branch X-Git-Commit: 8311bc5f17dec348749f763b82dfe2737bc53cd7 Auto-Submitted: auto-generated The branch main has been updated by des: URL: https://cgit.FreeBSD.org/src/commit/?id=8311bc5f17dec348749f763b82dfe2737bc53cd7 commit 8311bc5f17dec348749f763b82dfe2737bc53cd7 Author: Dag-Erling Smørgrav AuthorDate: 2024-04-04 13:40:47 +0000 Commit: Dag-Erling Smørgrav CommitDate: 2024-04-04 13:40:54 +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 --- 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