From nobody Wed Aug 5 15:10:23 2026 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 4hFYkY0hYfz6nPCP for ; Wed, 05 Aug 2026 15:10:29 +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 "YR1" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4hFYkX6zr3z3sKc for ; Wed, 05 Aug 2026 15:10:28 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1785942629; 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=gfyYjp3oiaoL899/Z4AOVvDqxfHnwwZVYz6QDpcoLvQ=; b=C7CePJhO3agSYZuFXWzKEWxkrGpv1CRIroxdr0x0VxAw6JF4lVLR0h20QY9QA+KlKzc502 mHiSUWhoMJl4E0m96MmZEUy+ezzFqlSBc5pnxfz4hztE24BYlNiDgzLOk7PF/Wa6ak74JD vj/kWKkDEa8iLT4DyYN9nPtX9QXLsuME1H2642zc5AwHIW01YADkL585kDs464KOeKPI9A wdQcl9XpBCgEGMfyDVDpipzuTwsJdnG/3YzuV5YPqzE7Wc/GhZO6tX6aZf3KohAMja6/c7 UTXK58TyEh6UnPJUu5wYqo84uPlATcq0sCWfpp49zxM14fLrn4N9ELNzZg9z5w== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1785942629; a=rsa-sha256; cv=none; b=EgIUnsRnXpb2NGNEkJgVzjl6DzMWZDpF1tUpTtX9SRzU5DTCb317g13deGbsiPmOjIKFrX X/z2NuWSNIr+6lGZShwy7iqB8SM4GIlXU2ZGDum5V0Wlq5eGl8yPZ9cPk91amNqf7Jj6Hg Zhe2hyhXSD4G8t7FjPh+xWw9FMi8R4TBHCZK4BtvXQ164ay3Zr97kKYSrWlxJ00JTnYS6g 012Dg6rw3L4C2Qj0BfgPeu+c0Wn2SZL9X1Zg1xjPfUCVnSO/bVSqmeZRnb2M79YIr+nX1x 2z4LLzL05P/C6hQb7jAfwZtpb/2fW/QESg1QClwuCRgu8+inXyLQJXZHaZtZhA== 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=1785942629; 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=gfyYjp3oiaoL899/Z4AOVvDqxfHnwwZVYz6QDpcoLvQ=; b=vjsVYHSRO0XyOE1UJZ2mDDgZKdKY3u0n3g3uEG7oFSfPW9E3Ref4DbI2jEtk6EULSNWuXm 0OkrcsXLhcPkffEH2oIHcLeC1Ned/ybIq4I19tAFoZbMGOOydk6S1OxKnwtrPoDRg3H5XW rbW8CNCgBHrChZ9D0ejrQKxqsdWa1jOHBUHSddc2pBjK+CBEL/3XCJO/bPlvmvg5ChFpzZ +b8Hi6Gi+NhC0mCE/zY6Oebk0LlYuzxRMqp607HB+ygbimJzls0Jwy0Y/r04LDfGBHZawS kfDy+z3Sk4gZSF1TDNtJ9Mwv/vEpdBLDfac8Fbx0UJBB5jw9eWBzVE8lBn3K6g== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4hFYkX5gDqzfqq for ; Wed, 05 Aug 2026 15:10:28 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 45e96 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Wed, 05 Aug 2026 15:10:23 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Alan Somers Subject: git: 1fcd8291b9ef - stable/14 - fusefs: fix a race in the pre-init tests 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: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: asomers X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 1fcd8291b9efc99e1d80e8e130f45c66e54d777e Auto-Submitted: auto-generated Date: Wed, 05 Aug 2026 15:10:23 +0000 Message-Id: <6a73525f.45e96.6db9f9f1@gitrepo.freebsd.org> The branch stable/14 has been updated by asomers: URL: https://cgit.FreeBSD.org/src/commit/?id=1fcd8291b9efc99e1d80e8e130f45c66e54d777e commit 1fcd8291b9efc99e1d80e8e130f45c66e54d777e Author: Alan Somers AuthorDate: 2026-06-23 17:12:04 +0000 Commit: Alan Somers CommitDate: 2026-08-05 15:08:50 +0000 fusefs: fix a race in the pre-init tests These tests allow the user to customize the INIT response. But it's necessary to block the daemon's service loop from running until those expectations have been set. This race has never caused failures before simply due to luck. But now it's failing on slower platforms. PR: 296236 Reported by: siva Sponsored by: ConnectWise Reviewed by: siva Differential Revision: https://reviews.freebsd.org/D57781 (cherry picked from commit 2c1482e305368af182a7bde0e53d0d180b319326) --- tests/sys/fs/fusefs/mockfs.cc | 11 ++++++++--- tests/sys/fs/fusefs/mockfs.hh | 3 +++ tests/sys/fs/fusefs/pre-init.cc | 6 ++++++ 3 files changed, 17 insertions(+), 3 deletions(-) diff --git a/tests/sys/fs/fusefs/mockfs.cc b/tests/sys/fs/fusefs/mockfs.cc index ba4c3381eff2..fb1a29e85496 100644 --- a/tests/sys/fs/fusefs/mockfs.cc +++ b/tests/sys/fs/fusefs/mockfs.cc @@ -540,9 +540,8 @@ MockFS::MockFS(int max_read, int max_readahead, bool allow_other, if (0 != sigaction(SIGUSR1, &sa, NULL)) throw(std::system_error(errno, std::system_category(), "Couldn't handle SIGUSR1")); - if (pthread_create(&m_daemon_id, NULL, service, (void*)this)) - throw(std::system_error(errno, std::system_category(), - "Couldn't Couldn't start fuse thread")); + if (!no_auto_init) + start_service(); } MockFS::~MockFS() { @@ -998,6 +997,12 @@ void MockFS::read_request(mockfs_buf_in &in, ssize_t &res) { ASSERT_TRUE(res == static_cast(in.header.len) || m_quit); } +void MockFS::start_service() { + if (pthread_create(&m_daemon_id, NULL, service, (void*)this)) + throw(std::system_error(errno, std::system_category(), + "Couldn't Couldn't start fuse thread")); +} + void MockFS::write_response(const mockfs_buf_out &out) { fd_set writefds; pollfd fds[1]; diff --git a/tests/sys/fs/fusefs/mockfs.hh b/tests/sys/fs/fusefs/mockfs.hh index f98a5337c9d1..3090701c815e 100644 --- a/tests/sys/fs/fusefs/mockfs.hh +++ b/tests/sys/fs/fusefs/mockfs.hh @@ -383,6 +383,9 @@ class MockFS { /* Process FUSE requests endlessly */ void loop(); + /* Begin processing requests from the kernel */ + void start_service(); + /* * Send an asynchronous notification to invalidate a directory entry. * Similar to libfuse's fuse_lowlevel_notify_inval_entry diff --git a/tests/sys/fs/fusefs/pre-init.cc b/tests/sys/fs/fusefs/pre-init.cc index 2d3257500304..70d7ddcdb0f4 100644 --- a/tests/sys/fs/fusefs/pre-init.cc +++ b/tests/sys/fs/fusefs/pre-init.cc @@ -102,6 +102,8 @@ TEST_F(PreInit, unmount_before_init) }))); expect_destroy(0); + m_mock->start_service(); + ASSERT_EQ(0, pthread_create(&th1, NULL, unmount1, NULL)); nap(); /* Wait for th1 to block in unmount() */ sem_post(&sem0); @@ -147,6 +149,8 @@ TEST_F(PreInit, signal_during_unmount_before_init) sem_wait(&sem0); }))); + m_mock->start_service(); + if ((child = ::fork()) == 0) { /* * In child. This will block waiting for FUSE_INIT to complete @@ -219,6 +223,8 @@ TEST_P(PreInitP, getattr_before_init) out.body.attr.attr_valid = UINT64_MAX; }))); + m_mock->start_service(); + EXPECT_EQ(0, stat("mountpoint", &sb)); EXPECT_EQ(nlink, sb.st_nlink); }