svn commit: r348930 - projects/fuse2/tests/sys/fs/fusefs

Alan Somers asomers at FreeBSD.org
Tue Jun 11 16:16:17 UTC 2019


Author: asomers
Date: Tue Jun 11 16:16:16 2019
New Revision: 348930
URL: https://svnweb.freebsd.org/changeset/base/348930

Log:
  fusefs: fix an infinite loop in the tests
  
  It was possible for the MockFS thread to infinitely loop if it got an error
  reading from /dev/fuse.
  
  Sponsored by:	The FreeBSD Foundation

Modified:
  projects/fuse2/tests/sys/fs/fusefs/mockfs.cc

Modified: projects/fuse2/tests/sys/fs/fusefs/mockfs.cc
==============================================================================
--- projects/fuse2/tests/sys/fs/fusefs/mockfs.cc	Tue Jun 11 15:52:41 2019	(r348929)
+++ projects/fuse2/tests/sys/fs/fusefs/mockfs.cc	Tue Jun 11 16:16:16 2019	(r348930)
@@ -637,8 +637,10 @@ void MockFS::read_request(mockfs_buf_in &in) {
 	}
 	res = read(m_fuse_fd, &in, sizeof(in));
 
-	if (res < 0 && !m_quit)
-		perror("read");
+	if (res < 0 && !m_quit) {
+		FAIL() << "read: " << strerror(errno);
+		m_quit = true;
+	}
 	ASSERT_TRUE(res >= static_cast<ssize_t>(sizeof(in.header)) || m_quit);
 }
 


More information about the svn-src-projects mailing list