From nobody Sat Nov 22 14:53:35 2025 X-Original-To: dev-commits-src-branches@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 4dDFTD0Lltz6HFrV for ; Sat, 22 Nov 2025 14:53:36 +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 4dDFTC3hbfz472P for ; Sat, 22 Nov 2025 14:53:35 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1763823215; 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=IhouENWbwYpLzxvM6vxyfa3W7Nry1GM8jTOiWg/toTY=; b=DpufsKufLP2nVHf4Gz5vxWz6tppmhsGcLMmAP5pVyoMeNNwepn9WqyPR8VFXwMfLnPu0mr QDwJoHQ4z8mMflrDLl9n1i2jh0S/cAYYlUVqLhdJYwT8xvIxRTgK7mkz7gZwNOrpopjjF3 ippH1bVfbZ6ZICv7fBUE5lYWCsgi6g8hYmqL3ti1f+yCG7FtVsOebpGIeiVt9QwirU9/H/ D7pzhlszoZpBhnX5quZYIOEWnKUJIpXHWAgMISbZZ/2Ln+bt8ZBVOuRPDcZ3ZaJwlrVgdb YqgAGy9ABam0dF3iAVrMRJQMu6iNhEaVF5le6B0MQB88aET2x2Hl824BONPxiQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1763823215; 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=IhouENWbwYpLzxvM6vxyfa3W7Nry1GM8jTOiWg/toTY=; b=ZMnoruQnkj04efyoAvp2rzUGCQTCiK1x42pxSTxrBmzggs+ktaCQtp6VDCPAsIf1laQcvF bDavuhTe+C9NOomJWFsFydL5uFP0R1tMieiiuHCXJHY9F8N3cRBeUSmnt3I+N5IQ4gTySZ 0YkIOCucV5qayhwpas3ykxp5P/h5JFK+SryU2hst02m3A3e6OStH1+x8vueYxiDglDqROa BxyS7gxgASqQZl1nSo98H+BcSToL3HJI/QzW8tfeuZbkehIXWiHsKGuJ2dQ8VEMLLyrZ3Z RsZ3ya/dT8LtkQdfa6e9s2fU3CH6T2rEwX7IcGz/HMgT7rFttkDrp0K8NBleIQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1763823215; a=rsa-sha256; cv=none; b=SGof0pUaQ1E1v1OtGVNOa9EyBD4q6z9BQFPYDX8M88fZ3xPQ1mAZ9zXQ3g2XENUiOl8PfW gCoo8M1T7ZhmvouiM5lQRG4WYxCsMm86K8BUwWwcPLlitVbbivBSoJ2PeAW96kxKt2KrfP 7u4KHcBO6Mh715X9hdeml4EoVQI7yBB232R4zFF9w8A8FxDg1/cddWYb4ObBp2Rdd8QHCq JHuOxhf5aJmwg0LO6EseQDtNNF5/+bS754QkWJ/s5YfME2LEq2m5SzhIWRzaLNKwyDC0Ma V1mUBfclQebOhObw1/HFLY9hqH2rxQLuW1azDwsFwVnyTDp0dI78ENpFZYHW6A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4dDFTC37wgz136Y for ; Sat, 22 Nov 2025 14:53:35 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 32a17 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Sat, 22 Nov 2025 14:53:35 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Alan Somers Subject: git: f6688f9ed5db - stable/14 - fusefs: Fix intermittency in the BadServer.ShortWrite test case List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@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/14 X-Git-Reftype: branch X-Git-Commit: f6688f9ed5db710e0026053f2f6b73051f87bc16 Auto-Submitted: auto-generated Date: Sat, 22 Nov 2025 14:53:35 +0000 Message-Id: <6921ce6f.32a17.792a255d@gitrepo.freebsd.org> The branch stable/14 has been updated by asomers: URL: https://cgit.FreeBSD.org/src/commit/?id=f6688f9ed5db710e0026053f2f6b73051f87bc16 commit f6688f9ed5db710e0026053f2f6b73051f87bc16 Author: Alan Somers AuthorDate: 2025-10-25 22:38:30 +0000 Commit: Alan Somers CommitDate: 2025-11-22 14:53:03 +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 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 4fa802cd7250..74458d7ca4cd 100644 --- a/tests/sys/fs/fusefs/mockfs.cc +++ b/tests/sys/fs/fusefs/mockfs.cc @@ -434,7 +434,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; @@ -980,7 +981,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,