From nobody Mon Apr 18 15:47:43 2022 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 33BC25D6A9F; Mon, 18 Apr 2022 15:47:44 +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 4Khrt80wy7z4lLw; Mon, 18 Apr 2022 15:47:44 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1650296864; 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=0cSrrm+4L6Ln1sBsSeBsFiAUv9YjNEdmk9/ey1L8WG4=; b=OF+Pc6QBKejmMbloMnJmhA/6ZnQ21g3JO0mTmKgJCELfezvtK/zD8iVw4PuIdDv2VwH67M qC5abEJg+wXyKg6YX5QEiQj+t9ZIt40mBQwBfa6mFUhSGCHycYN02IyjJksUoBqIkGg9bY JDXIchTM78dcE51klPhQE33E+yr8/M7XGO42DUF/WbZAhm4HisIGQ6/t7aL5Uy19jJFm3n PK90O0Jluz47jOX7fwpAcQ//GW0qSq/7XFztudhJZ5Et+/jOq1VbLIPLbqUAI73jXPKpfn 6n8tkm8vea1ARKAkLooZ9HeBvF5RoIY+FdS5QFjhwdcTWh5By5oQYyrqhpaC8g== 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 F02E2155E0; Mon, 18 Apr 2022 15:47:43 +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 23IFlhWI018117; Mon, 18 Apr 2022 15:47:43 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 23IFlhxG018116; Mon, 18 Apr 2022 15:47:43 GMT (envelope-from git) Date: Mon, 18 Apr 2022 15:47:43 GMT Message-Id: <202204181547.23IFlhxG018116@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mark Johnston Subject: git: 333f668468f0 - main - path_test: Correct the kevent test 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: markj X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 333f668468f0675e1e001f6fcc506e901e58c36e Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1650296864; 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=0cSrrm+4L6Ln1sBsSeBsFiAUv9YjNEdmk9/ey1L8WG4=; b=rBams9ZbNQWBq8KqXicMJYMNh00d85D2UuONoOe2dblVO44dI5q+flI/JZh1tBVI87zaM5 knS89DmV0TbLOS9ag1n646NW3T4Ifl4uicmKWskjUw1wMJtVimC7E9w1XMkwv7NBTpfhOP qM4oPMZlhkpfK9yFgseYURYUaBH8HJTyN73ljpGNaOnbesOkU7npTQXjoGkyIuSTK326dP Sg7IZ1Wai5IR01Rgh+hGrphheyL8mfZICIxUn8Jq+I5TIGz7kdBxeIeN6qVG5tMRp1beG0 n0YKl5MpXq51a3ghELnGvpG7UtzIxZRj9plYOqY/PjIJOV7fLtyhsIroQpKFuA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1650296864; a=rsa-sha256; cv=none; b=vTpyG+zLFytMkXsAPenJiaxE8oxhElafxpKqh/s0BX6o5nywVuWqEJm+Jx0kPYzhnreaQT HkiPN+TFA6PEby8kIRGM5/I9nAPiV1n0TP/TaWxhekhyEO7cmGMOwfDuutgGMGDLr7befT 1sRs00AKaMLcvyb2cbFizmkUCuhjG9jR2Ge8KV94kebhR3b3bPemghGr6t9EAy7tIxg0ou s4yFPPzcr4dn9X0Buu18FYfdxcTrLyVI8trvS5PsVse59FasrT+7P0oqjYabRW6h9NSB+l X76XPlzmf7NlUsDK9YjHzzhsgECjW1cSxg+2BN7nO6tnoWPxGaWSru1j2gsjtg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=333f668468f0675e1e001f6fcc506e901e58c36e commit 333f668468f0675e1e001f6fcc506e901e58c36e Author: Mark Johnston AuthorDate: 2022-04-18 15:45:45 +0000 Commit: Mark Johnston CommitDate: 2022-04-18 15:45:45 +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 MFC after: 3 days Sponsored by: The FreeBSD Foundation --- 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 39c653a07c1b..e8c8410a0bdf 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"));