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: d86025c1d4
MFC after: 1 week
Reviewed by: Siva Mahadevan <me@svmhdvn.name>
Differential Revision: https://reviews.freebsd.org/D54331
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user