From nobody Wed Apr 20 14:31:01 2022 X-Original-To: dev-commits-src-all@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 4ADB511E102B; Wed, 20 Apr 2022 14:31:02 +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 4Kk34k0lzwz3QjS; Wed, 20 Apr 2022 14:31:02 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1650465062; 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=1Uszq/a9RfBWn34JKkiT3It/kd4cEkAVXe9h+og9Htg=; b=V38Tl+iJJenjW/6uMJaY2ZORGNfv5qiZr1VH6slXwpiw1+0YHyPPZGRJiqUeVQ4KEYZp4t 97d6gNWETRQVnGnnTAbPHQA9XXksNzIxS0LJOf5qBoBWmab4KrUwIc0udFbrpNMdLSybqS iV/8/YXCn9su0sFUyMqo8aunDWxCO9h6JDGa0DpmMOoKZ8C+Db5D+V8VGf26vfm7zqdlu0 tv9KjMsCSlFLsBKBMBz2/DIuDfuYkNZk0W5BhAAxsEGP+qC2vT1/XmMeTXKw8+ybce20Q+ On4/jy76oEBsZdCAHRSzAJpqEAWzY/oDXdOlbWyEttgZOUYP6Xr8vu39OuJbrA== 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 E766F1557D; Wed, 20 Apr 2022 14:31:01 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 23KEV1u9021826; Wed, 20 Apr 2022 14:31:01 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 23KEV1hr021825; Wed, 20 Apr 2022 14:31:01 GMT (envelope-from git) Date: Wed, 20 Apr 2022 14:31:01 GMT Message-Id: <202204201431.23KEV1hr021825@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mark Johnston Subject: git: 3861fe8ba8c9 - stable/13 - path_test: Correct the kevent test List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 3861fe8ba8c96e52a7f3870cd723d14a54db4d76 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1650465062; 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=1Uszq/a9RfBWn34JKkiT3It/kd4cEkAVXe9h+og9Htg=; b=CEcaP59a66yYvy3asd+fLeSRHIjGu0O75Qv0CNYFS7B0gz6vny0trwZtGTUJOlKIOZoXXQ 9WVXC60vGNKpw/1rTsTYBnVTgZlv4JbWgdWLiTHvZzvXkBOfs1qk6jwNGhx/CnUCFq/B5+ svWnv8asUAXx1Y0YKFMfhsAU71AneEYoBAdVh8/VSZe2DzeApqL9spuiP2/WHvuNxMsbmf IuUwXpBbFTse45VX9c3G2wBSIavSYwtsG/PGGeicxwVD+mDKzcncNZ9YpNUYhO1icIa4RL byxHF/u8HTzPaab9tek5+YjB3mqb13eirQroFZEKcI8cZxIQVeE7eJIFakqJdw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1650465062; a=rsa-sha256; cv=none; b=MWRysrMSfpym7FG38TyOF1rplLIpCyGm1s6DU88QA5udRvJB7PySk3SCopYUjTBqojyiBo DqX03c9Kf8VkHJANXqphZQReEPuAdDAK8ClhAhb/v1xpwrv1SJOsrP1GM2DVQldQo9UvHZ jXf5lQ7aXsY9GLcgMMfk4sAUmK4pLHmkDrHJ4nfIwBRuEekdsPikaJ4gQt5QITSpZlRcYH vwCZLWvK7sczamp0+uTJ6j+oBYUMDxf7TCeEYa43zFrByqt0dqmN+A6WL+6ZAiAjUds2RV CF8I+/SSKd7PXbTnlYkpRmoJcmW7dgoNmFkvN0N/kJAGNH2y2I1JJWnPPTEnDg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=3861fe8ba8c96e52a7f3870cd723d14a54db4d76 commit 3861fe8ba8c96e52a7f3870cd723d14a54db4d76 Author: Mark Johnston AuthorDate: 2022-04-18 15:45:45 +0000 Commit: Mark Johnston CommitDate: 2022-04-20 14:15:06 +0000 path_test: Correct the kevent test Perhaps surprisingly, and contrary to the expectations of path_test:path_event, NOTE_LINK events are not raised when a file is unlinked. Prior to commit bf13db086b84, the test happened to work because unlinking the file would cause the vnode to be recycled, and EVFILT_VNODE knotes deliver an event with EV_EOF set when the vnode is doomed. Since the test did not verify the note type, the test succeeded. After commit bf13db086b84, the vnode is not recycled after being unlinked and so the test hangs. Fix the test by waiting for NOTE_DELETE instead, and check that we got the note that we expected. Reported by: Jenkins Sponsored by: The FreeBSD Foundation (cherry picked from commit 333f668468f0675e1e001f6fcc506e901e58c36e) --- tests/sys/file/path_test.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/tests/sys/file/path_test.c b/tests/sys/file/path_test.c index a39862cc78d6..b4411b67f26d 100644 --- a/tests/sys/file/path_test.c +++ b/tests/sys/file/path_test.c @@ -452,14 +452,17 @@ ATF_TC_BODY(path_event, tc) ATF_REQUIRE_MSG(kevent(kq, &ev, 1, NULL, 0, NULL) == 0, FMT_ERR("kevent")); - /* Try to get a EVFILT_VNODE/NOTE_LINK event through a path fd. */ - EV_SET(&ev, pathfd, EVFILT_VNODE, EV_ADD | EV_ENABLE, NOTE_LINK, 0, 0); + /* Try to get a EVFILT_VNODE/NOTE_DELETE event through a path fd. */ + EV_SET(&ev, pathfd, EVFILT_VNODE, EV_ADD | EV_ENABLE, NOTE_DELETE, 0, + 0); ATF_REQUIRE_MSG(kevent(kq, &ev, 1, NULL, 0, NULL) == 0, FMT_ERR("kevent")); ATF_REQUIRE_MSG(funlinkat(AT_FDCWD, path, pathfd, 0) == 0, FMT_ERR("funlinkat")); ATF_REQUIRE_MSG(kevent(kq, NULL, 0, &ev, 1, NULL) == 1, FMT_ERR("kevent")); + ATF_REQUIRE_MSG(ev.fflags == NOTE_DELETE, + "unexpected fflags %#x", ev.fflags); EV_SET(&ev, pathfd, EVFILT_VNODE, EV_DELETE, 0, 0, 0); ATF_REQUIRE_MSG(kevent(kq, &ev, 1, NULL, 0, NULL) == 0, FMT_ERR("kevent"));