From nobody Thu Nov 06 23:11:51 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 4d2dHX318Tz6FtMx; Thu, 06 Nov 2025 23:11:52 +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 4d2dHX1CG7z3gfG; Thu, 06 Nov 2025 23:11:52 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1762470712; 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=1uZTmGWQ1OemZSiyieGBPZz34QGFJNVbzrXxo8it7K4=; b=xuRzgjRrr96tdflsqwTQt0LrI0W+ue/37plbcHltZCbQJhzRy0CYTaDUwY6dtr3hq7iWNc ouv/KH5TNgK23VHnqtbwgjkpqN9NIK1RLTlpT+ufgl0OYn9NdHOO6/Q0igI/UnRDO2a66q KyMWUmd6jVWijljp5kCsTitxfdc5oec32qWKEwpTMMQJjJ4RDHhLpt7ocbDyEWLjETcHkj 1qwqE3zCrvECvcu58uycIPna/mMxU3P5LBs0lcZTMzrOAX5Z6txUOVNMmvIN0Bcnl3+2GO hZ0VzD/CbC0BegAyub/Z5G+gqbmZEttpFPSVTTNFgfgdKCMQEOpOOszS5n/stA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1762470712; 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=1uZTmGWQ1OemZSiyieGBPZz34QGFJNVbzrXxo8it7K4=; b=UlpQVENTfw/L34KLcXi2Q0SKc3NJ5F68534Y0SayGyl/vGUi/Y49HE3ouL5Hc0Pv//DuHv XsvP8l9BpmOe2f7jSEIF10gC8MLV6VPEJvkMp1uAQ4tRHX32SDL/qluB4oHQaRZTbFeBwT 3Vc6XeTGSsgjFF6pdcJ36g1I1R07dJjW+QoY/Z05Ripa3K7hfTXh2Hl2CFo3SGo4fxF/sJ CZeR0KoPG3bixWXlU9tFustGW9TQaIbpmR8UWINsCxdvljtgq3YNffknYFYqsMdP2h9VQW /HSQWLyLcLl7m4sOEkwBE2ScLpN67i+cI6KFEDljng/syGHrwOCjae9Ez5sgMw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1762470712; a=rsa-sha256; cv=none; b=X8mXbZn8XCbnWe936gk7AsTew6BgC6xkiq8n7gTUJQoA01haUgj1p+2lm9QGB/FrkOTgYF 4obQi6Y1sXf2C/uDNsPc7F1yz7oPIgoXN8hx7rNnAlAeQ5ISU4Dcyc4mEhx9tmL9WO3say SAHAFG05F279RdUH3p90koEze6tz5eoZnwPiIbuAlaVFtRThHARdEJp3HNiZ3Uy7FSDB5G B4M2bwRZEjzBLwNkTIpX+r2lmTvES0IsDpZT55cmw2iTyL3RI/LgJwp4ciJXE5aDDt3gpI 6JL+/pmsbDWXkTGh8xd+1uwsLPaV25harCjbUgmPvbo8rbz5Wn/JiST22mNcGQ== 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 4d2dHX0ldvzbCH; Thu, 06 Nov 2025 23:11:52 +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 5A6NBqt6010402; Thu, 6 Nov 2025 23:11:52 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 5A6NBpR0010399; Thu, 6 Nov 2025 23:11:51 GMT (envelope-from git) Date: Thu, 6 Nov 2025 23:11:51 GMT Message-Id: <202511062311.5A6NBpR0010399@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Colin Percival Subject: git: 06edf53ab5c4 - releng/15.0 - 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: cperciva X-Git-Repository: src X-Git-Refname: refs/heads/releng/15.0 X-Git-Reftype: branch X-Git-Commit: 06edf53ab5c4e6466b0aba18ffe5fd7be585c636 Auto-Submitted: auto-generated The branch releng/15.0 has been updated by cperciva: URL: https://cgit.FreeBSD.org/src/commit/?id=06edf53ab5c4e6466b0aba18ffe5fd7be585c636 commit 06edf53ab5c4e6466b0aba18ffe5fd7be585c636 Author: Alan Somers AuthorDate: 2025-10-25 22:38:30 +0000 Commit: Colin Percival CommitDate: 2025-11-06 23:10:59 +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. Approved by: re (cperciva) Reported by: Siva Mahadevan MFC after: 1 week Revied by: Siva Mahadevan Differential Revision: https://reviews.freebsd.org/D53357 (cherry picked from commit d86025c1d49c84c4dc8c3635c83c078ad56e5a53) (cherry picked from commit f0cf086c05d86f962d259895bcb50ba8ca4c10e0) --- 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,