From nobody Thu Nov 06 00:38:38 2025 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 4d23G65KF9z6FB3F; Thu, 06 Nov 2025 00:38:38 +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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4d23G63Fkmz3dHT; Thu, 06 Nov 2025 00:38:38 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1762389518; 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=Avjrm4ckyo+pbtMVXGLBz2AiXLkODC5OrMXJdQjwly4=; b=JRoSdKrh1SezGeKOytkidi8de//9RnMYAk6KOQbLj0q4V18j8u9Eu+F0y8m73hPLth0Pc6 Q95ErzztE8q/q5iINoG5fVAm/KejRxHdMjwbLKB62x6fvhHXKjefNYXZpc9XPdTBWLPmMO gkoYRIvgwuoDGdVSIiRsLSvn3R992kiKl1QkU30o2xrvrocSTtBlxvHwnE3pIIMaUmWYiQ CMzFj+pSO1pNacSz3a4JYXf1r79Tu/a8sRMhRZ6j5ke7XACIxLowFfvNKOmeTp7KVcyV7m pOy2nDb33a+RXj1SnoSwEMJwLMIbd7Rs5qgoCOLtfwZcoEuCIRSO8E8N2eKDZw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1762389518; 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=Avjrm4ckyo+pbtMVXGLBz2AiXLkODC5OrMXJdQjwly4=; b=AVCFL9b5j592qc7AvjxkY8E2gu2qNYMW9r09pBoVnnYC3lyKGHaek5Cxxy+M1F6rIDIFx5 YzS2q2WwCAtLqmBft6uUiO1qeQX5G5v2PNNBaioh7fWoipEPR1PKlUE6VsYjLy8QiVNace Z+fvTbL5Jtdd3MpTSCZhYqbWlu9NriDtTBRThj3M41KTFzs9ZeoTyxhaSIQAhTUj8CjemY hpL7o+LlFO4dKxL65VPRI4tuafVBWM7RPaW/gT6iea66k5LSnRRivJOlzb+I1XZF4ixl48 ImsqjclhXo9IFrQsyqp5H3dYEXsfh0hOr9f1vcslku8990i4gHaWvOTn+S72iQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1762389518; a=rsa-sha256; cv=none; b=FjWbzxWOUPQDCHUZmfvPEXDPSSw2RLF2hG6wkyMAi0bdH/GTZbSg0mdX5x13H3h6FVSosN GdQTd4s/cc0+xRpqzXPtoztiGOGy29XTVKmR7BFD7P+toJKVtdNaKFbZYoEZh46aAJse7I ZD7QAqc1RGNzCrl1RIChdGR2uwUWzee/4iy5XRN9QQXYkqqNIWgFtGbCKXfTBouE3OOID4 kVA8kfS9l4k30Ixkpx1QiOPpUhRmL0KDUG9nRTNtUegixOBluB3A4t3BulxOjCORvH3rzN chXSnkh7CNprDw7JgsFQ/XqYd3QQkLPmsQCj2vMQF3oQ7XEzESAuOYaVsvknzQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none 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 4d23G62sdKz15tK; Thu, 06 Nov 2025 00:38:38 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 5A60ccTM052217; Thu, 6 Nov 2025 00:38:38 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 5A60ccno052214; Thu, 6 Nov 2025 00:38:38 GMT (envelope-from git) Date: Thu, 6 Nov 2025 00:38:38 GMT Message-Id: <202511060038.5A60ccno052214@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Alan Somers Subject: git: f0cf086c05d8 - stable/15 - fusefs: Fix intermittency in the BadServer.ShortWrite test case 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 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/15 X-Git-Reftype: branch X-Git-Commit: f0cf086c05d86f962d259895bcb50ba8ca4c10e0 Auto-Submitted: auto-generated The branch stable/15 has been updated by asomers: URL: https://cgit.FreeBSD.org/src/commit/?id=f0cf086c05d86f962d259895bcb50ba8ca4c10e0 commit f0cf086c05d86f962d259895bcb50ba8ca4c10e0 Author: Alan Somers AuthorDate: 2025-10-25 22:38:30 +0000 Commit: Alan Somers CommitDate: 2025-11-06 00:25:23 +0000 fusefs: Fix intermittency in the BadServer.ShortWrite test case We were using the m_quit bit for two similar but distinct uses: * To instruct the server to quit * To cope with the kernel forcibly unmounting the fs Fix the intermittent test failure by adding a separate bit, m_expect_unmount, to handle cases like the latter. Reported by: Siva Mahadevan MFC after: 1 week Revied by: Siva Mahadevan Differential Revision: https://reviews.freebsd.org/D53357 (cherry picked from commit d86025c1d49c84c4dc8c3635c83c078ad56e5a53) --- tests/sys/fs/fusefs/bad_server.cc | 8 ++++---- tests/sys/fs/fusefs/mockfs.cc | 5 +++-- tests/sys/fs/fusefs/mockfs.hh | 3 +++ 3 files changed, 10 insertions(+), 6 deletions(-) diff --git a/tests/sys/fs/fusefs/bad_server.cc b/tests/sys/fs/fusefs/bad_server.cc index c3d195735446..825523cac2bb 100644 --- a/tests/sys/fs/fusefs/bad_server.cc +++ b/tests/sys/fs/fusefs/bad_server.cc @@ -64,12 +64,12 @@ TEST_F(BadServer, ShortWrite) out.header.error = 0; out.header.unique = 0; // Asynchronous notification out.expected_errno = EINVAL; - m_mock->write_response(out); /* - * Tell the event loop to quit. The kernel has already disconnected us + * Tell the event loop to quit. The kernel will disconnect us * because of the short write. */ - m_mock->m_quit = true; + m_mock->m_expect_unmount = true; + m_mock->write_response(out); } /* @@ -98,7 +98,7 @@ TEST_F(BadServer, ErrorWithPayload) out.push_back(std::move(out1)); // The kernel may disconnect us for bad behavior, so don't try - // to read any more. + // to read or write any more. m_mock->m_quit = true; })); diff --git a/tests/sys/fs/fusefs/mockfs.cc b/tests/sys/fs/fusefs/mockfs.cc index 55c191716629..b6a32d9b60af 100644 --- a/tests/sys/fs/fusefs/mockfs.cc +++ b/tests/sys/fs/fusefs/mockfs.cc @@ -433,7 +433,8 @@ MockFS::MockFS(int max_read, int max_readahead, bool allow_other, m_child_pid(-1), m_maxwrite(MIN(max_write, max_max_write)), m_nready(-1), - m_quit(false) + m_quit(false), + m_expect_unmount(false) { struct sigaction sa; struct iovec *iov = NULL; @@ -979,7 +980,7 @@ void MockFS::read_request(mockfs_buf_in &in, ssize_t &res) { } res = read(m_fuse_fd, &in, sizeof(in)); - if (res < 0 && !m_quit) { + if (res < 0 && errno != EBADF && !m_quit && !m_expect_unmount) { m_quit = true; FAIL() << "read: " << strerror(errno); } diff --git a/tests/sys/fs/fusefs/mockfs.hh b/tests/sys/fs/fusefs/mockfs.hh index 4b0628d34dd7..f98a5337c9d1 100644 --- a/tests/sys/fs/fusefs/mockfs.hh +++ b/tests/sys/fs/fusefs/mockfs.hh @@ -360,6 +360,9 @@ class MockFS { /* Tell the daemon to shut down ASAP */ bool m_quit; + /* Tell the daemon that the server might forcibly unmount us */ + bool m_expect_unmount; + /* Create a new mockfs and mount it to a tempdir */ MockFS(int max_read, int max_readahead, bool allow_other, bool default_permissions, bool push_symlinks_in, bool ro,