git: 3b5c296fa151 - stable/14 - fusefs: Fix further intermittency in the BadServer.ShortWrite test case
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Tue, 20 Jan 2026 17:15:03 UTC
The branch stable/14 has been updated by asomers:
URL: https://cgit.FreeBSD.org/src/commit/?id=3b5c296fa1519a7fbfb8c48703bcacadd4b7d9c0
commit 3b5c296fa1519a7fbfb8c48703bcacadd4b7d9c0
Author: Alan Somers <asomers@FreeBSD.org>
AuthorDate: 2025-12-21 15:32:31 +0000
Commit: Alan Somers <asomers@FreeBSD.org>
CommitDate: 2026-01-20 17:14:21 +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
Reviewed by: Siva Mahadevan <me@svmhdvn.name>
Differential Revision: https://reviews.freebsd.org/D54331
(cherry picked from commit f51e9d0e0988df58c94db586ab5c8b5fd091c004)
---
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 74458d7ca4cd..ba4c3381eff2 100644
--- a/tests/sys/fs/fusefs/mockfs.cc
+++ b/tests/sys/fs/fusefs/mockfs.cc
@@ -981,7 +981,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);
}