<feed xmlns='http://www.w3.org/2005/Atom'>
<title>src-test/tests/sys/fs, branch main</title>
<subtitle>FreeBSD source tree</subtitle>
<id>https://cgit-dev.freebsd.org/src-test/atom?h=main</id>
<link rel='self' href='https://cgit-dev.freebsd.org/src-test/atom?h=main'/>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src-test/'/>
<updated>2020-10-02T17:06:05Z</updated>
<entry>
<title>fusefs tests: quell Coverity "Argument cannot be negative" warnings</title>
<updated>2020-10-02T17:06:05Z</updated>
<author>
<name>Alan Somers</name>
<email>asomers@FreeBSD.org</email>
</author>
<published>2020-10-02T17:06:05Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src-test/commit/?id=d262168916de41ea1f9b2d57c67a9842e0b63c45'/>
<id>urn:sha1:d262168916de41ea1f9b2d57c67a9842e0b63c45</id>
<content type='text'>
Must abort tests early if open(2) fails.

Reported by:	Coverity
Coverity CID:	1432810 and many others
Reviewed by:	kevans
MFC after:	2 weeks
Differential Revision:	https://reviews.freebsd.org/D26635
</content>
</entry>
<entry>
<title>Do a sweep and remove most WARNS=6 settings</title>
<updated>2020-10-01T01:10:51Z</updated>
<author>
<name>Kyle Evans</name>
<email>kevans@FreeBSD.org</email>
</author>
<published>2020-10-01T01:10:51Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src-test/commit/?id=7cc42f6d25ef2e19059d088fa7d4853fe9afefb5'/>
<id>urn:sha1:7cc42f6d25ef2e19059d088fa7d4853fe9afefb5</id>
<content type='text'>
Repeating the default WARNS here makes it slightly more difficult to
experiment with default WARNS changes, e.g. if we did something absolutely
bananas and introduced a WARNS=7 and wanted to try lifting the default to
that.

Drop most of them; there is one in the blake2 kernel module, but I suspect
it should be dropped -- the default WARNS in the rest of the build doesn't
currently apply to kernel modules, and I haven't put too much thought into
whether it makes sense to make it so.
</content>
</entry>
<entry>
<title>fusefs: fix mmap'd writes in direct_io mode</title>
<updated>2020-09-24T16:27:53Z</updated>
<author>
<name>Alan Somers</name>
<email>asomers@FreeBSD.org</email>
</author>
<published>2020-09-24T16:27:53Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src-test/commit/?id=a62772a78e524da2de90f67bf8824b8a3035dd5c'/>
<id>urn:sha1:a62772a78e524da2de90f67bf8824b8a3035dd5c</id>
<content type='text'>
If a FUSE server returns FOPEN_DIRECT_IO in response to FUSE_OPEN, that
instructs the kernel to bypass the page cache for that file. This feature
is also known by libfuse's name: "direct_io".

However, when accessing a file via mmap, there is no possible way to bypass
the cache completely. This change fixes a deadlock that would happen when
an mmap'd write tried to invalidate a portion of the cache, wrongly assuming
that a write couldn't possibly come from cache if direct_io were set.

Arguably, we could instead disable mmap for files with FOPEN_DIRECT_IO set.
But allowing it is less likely to cause user complaints, and is more in
keeping with the spirit of open(2), where O_DIRECT instructs the kernel to
"reduce", not "eliminate" cache effects.

PR:		247276
Reported by:	trapexit@spawn.link
Reviewed by:	cem
MFC after:	3 days
Differential Revision:	https://reviews.freebsd.org/D26485
</content>
</entry>
<entry>
<title>fusefs: fix the FUSE_FORGET unit test after r364064</title>
<updated>2020-08-11T01:09:06Z</updated>
<author>
<name>Alan Somers</name>
<email>asomers@FreeBSD.org</email>
</author>
<published>2020-08-11T01:09:06Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src-test/commit/?id=8d2105da1660dd79e4e287cb14c34651bc086bf9'/>
<id>urn:sha1:8d2105da1660dd79e4e287cb14c34651bc086bf9</id>
<content type='text'>
Thanks to r364064, the name cache now returns a hit where previously it
would miss.  Adjust the expectations accordingly.

PR:		248583
Reported by:	lwhsu
MFC with:	r364064
</content>
</entry>
<entry>
<title>Fix issues with FUSE_ACCESS when default_permissions is disabled</title>
<updated>2020-05-22T18:11:17Z</updated>
<author>
<name>Alan Somers</name>
<email>asomers@FreeBSD.org</email>
</author>
<published>2020-05-22T18:11:17Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src-test/commit/?id=bfcb817bcd70fa17c7e65e72f15089eee9e53ce3'/>
<id>urn:sha1:bfcb817bcd70fa17c7e65e72f15089eee9e53ce3</id>
<content type='text'>
This patch fixes two issues relating to FUSE_ACCESS when the
default_permissions mount option is disabled:

* VOP_ACCESS() calls with VADMIN set should never be sent to a fuse server
  in the form of FUSE_ACCESS operations. The FUSE protocol has no equivalent
  of VADMIN, so we must evaluate such things kernel-side, regardless of the
  default_permissions setting.

* The FUSE protocol only requires FUSE_ACCESS to be sent for two purposes:
  for the access(2) syscall and to check directory permissions for
  searchability during lookup. FreeBSD sends it much more frequently, due to
  differences between our VFS and Linux's, for which FUSE was designed. But
  this patch does eliminate several cases not required by the FUSE protocol:

  * for any FUSE_*XATTR operation
  * when creating a new file
  * when deleting a file
  * when setting timestamps, such as by utimensat(2).

* Additionally, when default_permissions is disabled, this patch removes one
  FUSE_GETATTR operation when deleting a file.

PR:		245689
Reported by:	MooseFS FreeBSD Team &lt;freebsd@moosefs.pro&gt;
Reviewed by:	cem
MFC after:	2 weeks
Differential Revision:	https://reviews.freebsd.org/D24777
</content>
</entry>
<entry>
<title>fusefs: fix intermittency in some ENOENT tests</title>
<updated>2020-05-18T18:36:32Z</updated>
<author>
<name>Alan Somers</name>
<email>asomers@FreeBSD.org</email>
</author>
<published>2020-05-18T18:36:32Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src-test/commit/?id=275379902e8eb40e67232e6eb39ee8ae3f13b0bb'/>
<id>urn:sha1:275379902e8eb40e67232e6eb39ee8ae3f13b0bb</id>
<content type='text'>
When a FUSE operation other than LOOKUP returns ENOENT, the kernel will
reclaim that vnode, resuling in a FUSE_FORGET being sent a short while
later.  Many of the ENOENT tests weren't expecting those FUSE_FORGET
operations.  They usually passed by luck since FUSE_FORGET is often delayed.
This commit adds appropriate expectations.

MFC after:	2 weeks
</content>
</entry>
<entry>
<title>fusefs: fix two small bugs in the tests' expectations</title>
<updated>2020-05-08T23:00:02Z</updated>
<author>
<name>Alan Somers</name>
<email>asomers@FreeBSD.org</email>
</author>
<published>2020-05-08T23:00:02Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src-test/commit/?id=a22a780752399c96bea63f2ce4d461d3a5f1a12f'/>
<id>urn:sha1:a22a780752399c96bea63f2ce4d461d3a5f1a12f</id>
<content type='text'>
These two errors have been present since the tests' introduction.
Coincidentally every test (I think there's only one) that cares about that
field also works when the field's value is 0.

MFC after:	2 weeks
</content>
</entry>
<entry>
<title>Resolve conflict between the fusefs(5) and mac_bsdextended(4) tests</title>
<updated>2020-05-02T20:14:59Z</updated>
<author>
<name>Alan Somers</name>
<email>asomers@FreeBSD.org</email>
</author>
<published>2020-05-02T20:14:59Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src-test/commit/?id=b43a935caec0cc4ae1abef7851d67ba3d135411d'/>
<id>urn:sha1:b43a935caec0cc4ae1abef7851d67ba3d135411d</id>
<content type='text'>
mac_bsdextended(4), when enabled, causes ordinary operations to send many
more VOP_GETATTRs to file system. The fusefs tests expectations aren't
written with those in mind. Optionally expecting them would greatly
obfuscate the fusefs tests. Worse, certain fusefs functionality (like
attribute caching) would be impossible to test if the tests couldn't expect
an exact number of GETATTR operations.

This commit resolves that conflict by making two changes:

1. The fusefs tests will now check for mac_bsdextended, and skip if it's
   enabled.
2. The mac_bsdextended tests will now check whether the module is enabled, not
   merely loaded. If it's loaded but disabled, the tests will automatically
   enable it for the duration of the tests.

With these changes, a CI system can achieve best coverage by loading both
fusefs and mac_bsdextended at boot, and setting
security.mac.bsdextended.enabled=0

PR:		244229
Reported by:	lwhsu
Reviewed by:	cem
MFC after:	2 weeks
Differential Revision:	https://reviews.freebsd.org/D24577
</content>
</entry>
<entry>
<title>fusefs: avoid cache corruption with buggy fuse servers</title>
<updated>2020-03-11T04:29:45Z</updated>
<author>
<name>Alan Somers</name>
<email>asomers@FreeBSD.org</email>
</author>
<published>2020-03-11T04:29:45Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src-test/commit/?id=b0ecfb42d1705bc1423c726a16a182c81047f854'/>
<id>urn:sha1:b0ecfb42d1705bc1423c726a16a182c81047f854</id>
<content type='text'>
The FUSE protocol allows the client (kernel) to cache a file's size, if the
server (userspace daemon) allows it. A well-behaved daemon obviously should
not change a file's size while a client has it cached. But a buggy daemon
might. If the kernel ever detects that that has happened, then it should
invalidate the entire cache for that file. Previously, we would not only
cache stale data, but in the case of a file extension while we had the size
cached, we accidentally extended the cache with zeros.

PR:		244178
Reported by:	Ben RUBSON &lt;ben.rubson@gmx.com&gt;
Reviewed by:	cem
MFC after:	2 weeks
Differential Revision:	https://reviews.freebsd.org/D24012
</content>
</entry>
<entry>
<title>fusefs: fix fsync for files with multiple open handles</title>
<updated>2020-03-09T01:57:21Z</updated>
<author>
<name>Alan Somers</name>
<email>asomers@FreeBSD.org</email>
</author>
<published>2020-03-09T01:57:21Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src-test/commit/?id=d970778e6fafb5b5e165d4708ef0e8e83904c707'/>
<id>urn:sha1:d970778e6fafb5b5e165d4708ef0e8e83904c707</id>
<content type='text'>
We were reusing a structure for multiple operations, but failing to
reinitialize one member.  The result is that a server that cares about FUSE
file handle IDs would see one correct FUSE_FSYNC operation, and one with the
FHID unset.

PR:		244431
Reported by:	Agata &lt;chogata@gmail.com&gt;
MFC after:	2 weeks
</content>
</entry>
</feed>
