The branch main has been updated by asomers:

URL: 
https://cgit.FreeBSD.org/src/commit/?id=f51e9d0e0988df58c94db586ab5c8b5fd091c004

commit f51e9d0e0988df58c94db586ab5c8b5fd091c004
Author:     Alan Somers <[email protected]>
AuthorDate: 2025-12-21 15:32:31 +0000
Commit:     Alan Somers <[email protected]>
CommitDate: 2025-12-22 17:18:16 +0000

    fusefs: Fix further intermittency in the BadServer.ShortWrite test case
    
    After being unmounted, the mockfs server would occasionally read from
    /dev/fuse again, if the main function didn't exit fast enough, getting
    an ENODEV error.  Handle that appropriately.
    
    Reported by:    Siva Mahadevan <[email protected]>
    Fixes:          d86025c1d49c84c4dc8c3635c83c078ad56e5a53
    MFC after:      1 week
    Reviewed by:    Siva Mahadevan <[email protected]>
    Differential Revision: https://reviews.freebsd.org/D54331
---
 tests/sys/fs/fusefs/mockfs.cc | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/tests/sys/fs/fusefs/mockfs.cc b/tests/sys/fs/fusefs/mockfs.cc
index b6a32d9b60af..a377ba832ef5 100644
--- a/tests/sys/fs/fusefs/mockfs.cc
+++ b/tests/sys/fs/fusefs/mockfs.cc
@@ -980,7 +980,11 @@ void MockFS::read_request(mockfs_buf_in &in, ssize_t &res) 
{
        }
        res = read(m_fuse_fd, &in, sizeof(in));
 
-       if (res < 0 && errno != EBADF && !m_quit && !m_expect_unmount) {
+       if (res < 0 && errno == ENODEV && m_expect_unmount) {
+               /* The kernel unmounted us, as expected. */
+               m_quit = true;
+       }
+       if (res < 0 && errno != EBADF && !m_quit) {
                m_quit = true;
                FAIL() << "read: " << strerror(errno);
        }

Reply via email to