git: b6533f67c399 - stable/15 - 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 22:31:44 UTC
The branch stable/15 has been updated by asomers:
URL: https://cgit.FreeBSD.org/src/commit/?id=b6533f67c3990dd7db5b37625730db83bf2adc18
commit b6533f67c3990dd7db5b37625730db83bf2adc18
Author: Alan Somers <asomers@FreeBSD.org>
AuthorDate: 2025-12-21 15:32:31 +0000
Commit: Alan Somers <asomers@FreeBSD.org>
CommitDate: 2026-01-20 22:31:30 +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 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);
}