git: f51e9d0e0988 - main - fusefs: Fix further intermittency in the BadServer.ShortWrite test case
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Mon, 22 Dec 2025 17:18:32 UTC
The branch main has been updated by asomers:
URL: https://cgit.FreeBSD.org/src/commit/?id=f51e9d0e0988df58c94db586ab5c8b5fd091c004
commit f51e9d0e0988df58c94db586ab5c8b5fd091c004
Author: Alan Somers <asomers@FreeBSD.org>
AuthorDate: 2025-12-21 15:32:31 +0000
Commit: Alan Somers <asomers@FreeBSD.org>
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 <me@svmhdvn.name>
Fixes: d86025c1d49c84c4dc8c3635c83c078ad56e5a53
MFC after: 1 week
Reviewed by: Siva Mahadevan <me@svmhdvn.name>
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);
}