657fcf58 tuexen Jan. 1, 2022, 6:25 p.m.
MFC after:	3 days
Sponsored by:	Netflix, Inc.
cgit
4760956e tuexen Jan. 1, 2022, 6:17 p.m.
MFC after:	3 days
Sponsored by:	Netflix, Inc.
cgit
430df2ab tuexen Jan. 1, 2022, 6:04 p.m.
If there is no inp to check, exit the loop iterating through them.

Reported by:	syzbot+403406a9cbf082b36ea4@syzkaller.appspotmail.com
Reviewed by:	glebius
Sponsored by:	Netflix, Inc.
cgit
c2173903 emaste Jan. 1, 2022, 5:02 p.m.
Style(9) prefers NULL.

Sponsored by:	The FreeBSD Foundation
cgit
3640e305 imp Jan. 1, 2022, 4:49 p.m.
Sponsored by:		Netflix
cgit
ec3af9d0 se Jan. 1, 2022, 2:33 p.m.
a19bd8e3 se Jan. 1, 2022, 10:58 a.m.
A simplification of set operations removed side-effects of the
previous code, which are restored by this commit.
cgit
398c88c7 asomers Jan. 1, 2022, 4:05 a.m.
Now posix_fallocate will be correctly forwarded to fuse file system
servers, for those that support it.

MFC after:	2 weeks
Reviewed by:	pfg
Differential Revision: https://reviews.freebsd.org/D33389
cgit
76ef4f63 kib Jan. 1, 2022, 3:58 a.m.
Use NULL instead of raw 0

Sponsored by:	The FreeBSD Foundation
MFC after:	3 days
cgit
1613087a asomers Jan. 1, 2022, 3:38 a.m.
By default, FUSE file systems are assumed not to support lookups for "."
and "..".  They must opt-in to that.  To cope with this limitation, the
fusefs kernel module caches every fuse vnode's parent's inode number,
and uses that during VOP_LOOKUP for "..".  But if the parent's vnode has
been reclaimed that won't be possible.  Previously we paniced in this
situation.  Now, we'll return ESTALE instead.  Or, if the file system
has opted into ".." lookups, we'll just do that instead.

This commit also fixes VOP_LOOKUP to respect the cache timeout for ".."
lookups, if the FUSE file system specified a finite timeout.

PR:		259974
MFC after:	2 weeks
Reviewed by:	pfg
Differential Revision: https://reviews.freebsd.org/D33239
cgit
8d99a6b9 asomers Jan. 1, 2022, 3:38 a.m.
MFC after:	2 weeks
cgit
19ab3610 asomers Jan. 1, 2022, 1:04 a.m.
In an earlier version of the revision that created that sysctl (D20519)
the sysctl was gated by INVARIANTS, so the test had to check for it.
But in the committed version it is always available.

MFC after:	2 weeks
cgit
5169832c asomers Jan. 1, 2022, 12:43 a.m.
If FUSE_COPY_FILE_RANGE returns successfully, update the atime of the
source and the mtime and ctime of the destination.

MFC after:	2 weeks
Reviewers:	pfg
Differential Revision: https://reviews.freebsd.org/D33159
cgit
13d593a5 asomers Jan. 1, 2022, 12:38 a.m.
VOPs like VOP_SETATTR can change a file's size, with the vnode
exclusively locked.  But VOPs like VOP_LOOKUP look up the file size from
the server without the vnode locked.  So a race is possible.  For
example:

1) One thread calls VOP_SETATTR to truncate a file.  It locks the vnode
   and sends FUSE_SETATTR to the server.
2) A second thread calls VOP_LOOKUP and fetches the file's attributes from
   the server.  Then it blocks trying to acquire the vnode lock.
3) FUSE_SETATTR returns and the first thread releases the vnode lock.
4) The second thread acquires the vnode lock and caches the file's
   attributes, which are now out-of-date.

Fix this race by recording a timestamp in the vnode of the last time
that its filesize was modified.  Check that timestamp during VOP_LOOKUP
and VFS_VGET.  If it's newer than the time at which FUSE_LOOKUP was
issued to the server, ignore the attributes returned by FUSE_LOOKUP.

PR:		259071
Reported by:	Agata <chogata@moosefs.pro>
Reviewed by:	pfg
MFC after:	2 weeks
Differential Revision: https://reviews.freebsd.org/D33158
cgit
0c8968c6 imp Dec. 31, 2021, 10:09 p.m.
Sponsored by:		Netflix
cgit