#
b068bb09 |
| 08-Jan-2024 |
Konstantin Belousov <kib@FreeBSD.org> |
Add vnode_pager_clean_{a,}sync(9)
Bump __FreeBSD_version for ZFS use.
Reviewed by: markj Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D4
Add vnode_pager_clean_{a,}sync(9)
Bump __FreeBSD_version for ZFS use.
Reviewed by: markj Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D43356
show more ...
|
#
fdafd315 |
| 24-Nov-2023 |
Warner Losh <imp@FreeBSD.org> |
sys: Automated cleanup of cdefs and other formatting
Apply the following automated changes to try to eliminate no-longer-needed sys/cdefs.h includes as well as now-empty blank lines in a row.
Remov
sys: Automated cleanup of cdefs and other formatting
Apply the following automated changes to try to eliminate no-longer-needed sys/cdefs.h includes as well as now-empty blank lines in a row.
Remove /^#if.*\n#endif.*\n#include\s+<sys/cdefs.h>.*\n/ Remove /\n+#include\s+<sys/cdefs.h>.*\n+#if.*\n#endif.*\n+/ Remove /\n+#if.*\n#endif.*\n+/ Remove /^#if.*\n#endif.*\n/ Remove /\n+#include\s+<sys/cdefs.h>\n#include\s+<sys/types.h>/ Remove /\n+#include\s+<sys/cdefs.h>\n#include\s+<sys/param.h>/ Remove /\n+#include\s+<sys/cdefs.h>\n#include\s+<sys/capsicum.h>/
Sponsored by: Netflix
show more ...
|
Revision tags: release/14.0.0 |
|
#
685dc743 |
| 16-Aug-2023 |
Warner Losh <imp@FreeBSD.org> |
sys: Remove $FreeBSD$: one-line .c pattern
Remove /^[\s*]*__FBSDID\("\$FreeBSD\$"\);?\s*\n/
|
Revision tags: release/13.2.0, release/12.4.0 |
|
#
be280f60 |
| 25-Sep-2022 |
Alan Somers <asomers@FreeBSD.org> |
fusefs: truncate write if it would exceed RLIMIT_FSIZE
PR: 164793 MFC after: 2 weeks Reviewed by: kib Differential Revision: https://reviews.freebsd.org/D36703
|
#
cc65a412 |
| 18-Sep-2022 |
Konstantin Belousov <kib@FreeBSD.org> |
filesystems: return error from vn_rlimit_fsize() instead of EFBIG
Reviewed by: asomers, jah, markj Tested by: pho Sponsored by: The FreeBSD Foundation MFC after: 2 weeks Differential revision: https
filesystems: return error from vn_rlimit_fsize() instead of EFBIG
Reviewed by: asomers, jah, markj Tested by: pho Sponsored by: The FreeBSD Foundation MFC after: 2 weeks Differential revision: https://reviews.freebsd.org/D36625
show more ...
|
Revision tags: release/13.1.0 |
|
#
3a1b3c6a |
| 19-Apr-2022 |
Alan Somers <asomers@FreeBSD.org> |
fusefs: correctly handle servers that report too much data written
During a FUSE_WRITE, the kernel requests the server to write a certain amount of data, and the server responds with the amount that
fusefs: correctly handle servers that report too much data written
During a FUSE_WRITE, the kernel requests the server to write a certain amount of data, and the server responds with the amount that it actually did write. It is obviously an error for the server to write more than it was provided, and we always treated it as such, but there were two problems:
* If the server responded with a huge amount, greater than INT_MAX, it would trigger an integer overflow which would cause a panic.
* When extending the file, we wrongly set the file's size before validing the amount written.
PR: 263263 Reported by: Robert Morris <rtm@lcs.mit.edu> MFC after: 2 weeks Sponsored by: Axcient Reviewed by: emaste Differential Revision: https://reviews.freebsd.org/D34955
show more ...
|
#
3d856234 |
| 20-Jan-2022 |
Mark Johnston <markj@FreeBSD.org> |
fusefs: Address -Wunused-but-set-variable warnings
Reviewed by: asomers MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D33957
|
Revision tags: release/12.3.0 |
|
#
13d593a5 |
| 29-Nov-2021 |
Alan Somers <asomers@FreeBSD.org> |
Fix a race in fusefs that can corrupt a file's size.
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 serve
Fix a race in fusefs that can corrupt a file's size.
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
show more ...
|
#
df38ada2 |
| 17-Nov-2021 |
Bjoern A. Zeeb <bz@FreeBSD.org> |
modules: increase MAXMODNAME and provide backward compat
With various firmware files used by graphics and wireless drivers we are exceeding the current 32 character module name (file path in kldxref
modules: increase MAXMODNAME and provide backward compat
With various firmware files used by graphics and wireless drivers we are exceeding the current 32 character module name (file path in kldxref) length. In order to overcome this issue bump it to the maximum path length for the next version. To be able to MFC provide backward compat support for another version of the struct as the offsets for the second half change due to the array size increase.
MAXMODNAME being defined to MAXPATHLEN needs param.h to be included first. With only 7 modules (or LinuxKPI module.h) not doing that adjust them rather than including param.h in module.h [1].
Reported by: Greg V (greg unrelenting.technology) Sponsored by: The FreeBSD Foundation Suggested by: imp [1] MFC after: 10 days Reviewed by: imp (and others to different level) Differential Revision: https://reviews.freebsd.org/D32383
show more ...
|
#
dc433e15 |
| 05-Dec-2021 |
Alan Somers <asomers@FreeBSD.org> |
fusefs: inline fuse_io_dispatch
This function was always confusing, because it created an H-shaped callgraph: two functions called in and left via different paths based on which which called.
MFC a
fusefs: inline fuse_io_dispatch
This function was always confusing, because it created an H-shaped callgraph: two functions called in and left via different paths based on which which called.
MFC after: 2 weeks
show more ...
|
#
91972cfc |
| 29-Nov-2021 |
Alan Somers <asomers@FreeBSD.org> |
fusefs: update atime on reads when using cached attributes
When using cached attributes, whether or not the data cache is enabled, fusefs must update a file's atime whenever it reads from it, so lon
fusefs: update atime on reads when using cached attributes
When using cached attributes, whether or not the data cache is enabled, fusefs must update a file's atime whenever it reads from it, so long as it wasn't mounted with -o noatime. Update it in-kernel, and flush it to the server on close or during the next setattr operation.
The downside is that close() will now frequently trigger a FUSE_SETATTR upcall. But if you care about performance, you should be using -o noatime anyway.
MFC after: 2 weeks Reviewed by: pfg Differential Revision: https://reviews.freebsd.org/D33145
show more ...
|
#
032a5bd5 |
| 03-Oct-2021 |
Alan Somers <asomers@FreeBSD.org> |
fusefs: Fix a bug during VOP_STRATEGY when the server changes file size
If the FUSE server tells the kernel that a file's size has changed, then the kernel must invalidate any portion of that file i
fusefs: Fix a bug during VOP_STRATEGY when the server changes file size
If the FUSE server tells the kernel that a file's size has changed, then the kernel must invalidate any portion of that file in cache. But the kernel can't do that during VOP_STRATEGY, because the file's buffers are already locked. Instead, proceed with the write.
PR: 256937 Reported by: Agata <chogata@moosefs.pro> Tested by: Agata <chogata@moosefs.pro> MFC after: 2 weeks Reviewed by: pfg Differential Revision: https://reviews.freebsd.org/D32332
show more ...
|
#
5d94aaac |
| 03-Oct-2021 |
Alan Somers <asomers@FreeBSD.org> |
fusefs: quiet some cache-related warnings
If the FUSE server does something that would make our cache incoherent, we should print a warning to the user. However, we previously warned in some situat
fusefs: quiet some cache-related warnings
If the FUSE server does something that would make our cache incoherent, we should print a warning to the user. However, we previously warned in some situations when we shouldn't, such as if the file's size changed on the server _after_ our own attribute cache had expired. This change suppresses the warning in cases like that. It also moves the warning logic to a single place within the code.
PR: 256936 Reported by: Agata <chogata@moosefs.pro> Tested by: Agata <chogata@moosefs.pro>, jSML4ThWwBID69YC@protonmail.com MFC after: 2 weeks
show more ...
|
#
0b9a5c6f |
| 15-Jun-2021 |
Alan Somers <asomers@FreeBSD.org> |
fusefs: improve warnings about buggy FUSE servers
The fusefs driver will print warning messages about FUSE servers that commit protocol violations. Previously it would print those warnings on every
fusefs: improve warnings about buggy FUSE servers
The fusefs driver will print warning messages about FUSE servers that commit protocol violations. Previously it would print those warnings on every violation, but that could spam the console. Now it will print each warning no more than once per lifetime of the mount. There is also now a dtrace probe for each violation.
MFC after: 2 weeks Sponsored by: Axcient Reviewed by: emaste, pfg Differential Revision: https://reviews.freebsd.org/D30780
show more ...
|
Revision tags: release/13.0.0 |
|
#
2bfd8992 |
| 15-Feb-2021 |
Konstantin Belousov <kib@FreeBSD.org> |
vnode: move write cluster support data to inodes.
The data is only needed by filesystems that 1. use buffer cache 2. utilize clustering write support.
Requested by: mjg Reviewed by: asomers (previo
vnode: move write cluster support data to inodes.
The data is only needed by filesystems that 1. use buffer cache 2. utilize clustering write support.
Requested by: mjg Reviewed by: asomers (previous version), fsu (ext2 parts), mckusick Tested by: pho Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D28679
show more ...
|
#
92bbfe1f |
| 29-Dec-2020 |
Alan Somers <asomers@gmail.com> |
fusefs: implement FUSE_COPY_FILE_RANGE.
This updates the FUSE protocol to 7.28, though most of the new features are optional and are not yet implemented.
MFC after: 2 weeks Relnotes: yes Reviewed b
fusefs: implement FUSE_COPY_FILE_RANGE.
This updates the FUSE protocol to 7.28, though most of the new features are optional and are not yet implemented.
MFC after: 2 weeks Relnotes: yes Reviewed by: cem Differential Revision: https://reviews.freebsd.org/D27818
show more ...
|
Revision tags: release/12.2.0 |
|
#
a62772a7 |
| 24-Sep-2020 |
Alan Somers <asomers@FreeBSD.org> |
fusefs: fix mmap'd writes in direct_io mode
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
fusefs: fix mmap'd writes in direct_io mode
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
show more ...
|
#
586ee69f |
| 01-Sep-2020 |
Mateusz Guzik <mjg@FreeBSD.org> |
fs: clean up empty lines in .c and .h files
|
Revision tags: release/11.4.0 |
|
#
abd80ddb |
| 08-Dec-2019 |
Mateusz Guzik <mjg@FreeBSD.org> |
vfs: introduce v_irflag and make v_type smaller
The current vnode layout is not smp-friendly by having frequently read data avoidably sharing cachelines with very frequently modified fields. In part
vfs: introduce v_irflag and make v_type smaller
The current vnode layout is not smp-friendly by having frequently read data avoidably sharing cachelines with very frequently modified fields. In particular v_iflag inspected for VI_DOOMED can be found in the same line with v_usecount. Instead make it available in the same cacheline as the v_op, v_data and v_type which all get read all the time.
v_type is avoidably 4 bytes while the necessary data will easily fit in 1. Shrinking it frees up 3 bytes, 2 of which get used here to introduce a new flag field with a new value: VIRF_DOOMED.
Reviewed by: kib, jeff Differential Revision: https://reviews.freebsd.org/D22715
show more ...
|
Revision tags: release/12.1.0 |
|
#
61c1328e |
| 13-Sep-2019 |
Dimitry Andric <dim@FreeBSD.org> |
Merge ^/head r352105 through r352307.
|
#
6c0c3620 |
| 11-Sep-2019 |
Alan Somers <asomers@FreeBSD.org> |
fusefs: Fix iosize for FUSE_WRITE in 7.8 compat mode
When communicating with a FUSE server that implements version 7.8 (or older) of the FUSE protocol, the FUSE_WRITE request structure is 16 bytes s
fusefs: Fix iosize for FUSE_WRITE in 7.8 compat mode
When communicating with a FUSE server that implements version 7.8 (or older) of the FUSE protocol, the FUSE_WRITE request structure is 16 bytes shorter than normal. The protocol version check wasn't applied universally, leading to an extra 16 bytes being sent to such servers. The extra bytes were allocated and bzero()d, so there was no information disclosure.
Reviewed by: emaste MFC after: 3 days MFC-With: r350665 Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D21557
show more ...
|
#
0b4275ac |
| 07-Aug-2019 |
Alan Somers <asomers@FreeBSD.org> |
fusefs: merge from projects/fuse2
This commit imports the new fusefs driver. It raises the protocol level from 7.8 to 7.23, fixes many bugs, adds a test suite for the driver, and adds many new featu
fusefs: merge from projects/fuse2
This commit imports the new fusefs driver. It raises the protocol level from 7.8 to 7.23, fixes many bugs, adds a test suite for the driver, and adds many new features. New features include:
* Optional kernel-side permissions checks (-o default_permissions) * Implement VOP_MKNOD, VOP_BMAP, and VOP_ADVLOCK * Allow interrupting FUSE operations * Support named pipes and unix-domain sockets in fusefs file systems * Forward UTIME_NOW during utimensat(2) to the daemon * kqueue support for /dev/fuse * Allow updating mounts with "mount -u" * Allow exporting fusefs file systems over NFS * Server-initiated invalidation of the name cache or data cache * Respect RLIMIT_FSIZE * Try to support servers as old as protocol 7.4
Performance enhancements include:
* Implement FUSE's FOPEN_KEEP_CACHE and FUSE_ASYNC_READ flags * Cache file attributes * Cache lookup entries, both positive and negative * Server-selectable cache modes: writethrough, writeback, or uncached * Write clustering * Readahead * Use counter(9) for statistical reporting
PR: 199934 216391 233783 234581 235773 235774 235775 PR: 236226 236231 236236 236291 236329 236381 236405 PR: 236327 236466 236472 236473 236474 236530 236557 PR: 236560 236844 237052 237181 237588 238565 Reviewed by: bcr (man pages) Reviewed by: cem, ngie, rpokala, glebius, kib, bde, emaste (post-commit review on project branch) MFC after: 3 weeks Relnotes: yes Sponsored by: The FreeBSD Foundation Pull Request: https://reviews.freebsd.org/D21110
show more ...
|
#
669a092a |
| 28-Jul-2019 |
Alan Somers <asomers@FreeBSD.org> |
fusefs: fix panic when writing with O_DIRECT and using writeback cache
When a fusefs file system is mounted using the writeback cache, the cache may still be bypassed by opening a file with O_DIRECT
fusefs: fix panic when writing with O_DIRECT and using writeback cache
When a fusefs file system is mounted using the writeback cache, the cache may still be bypassed by opening a file with O_DIRECT. When writing with O_DIRECT, the cache must be invalidated for the affected portion of the file. Fix some panics caused by inadvertently invalidating too much.
Sponsored by: The FreeBSD Foundation
show more ...
|
Revision tags: release/11.3.0 |
|
#
8aafc8c3 |
| 28-Jun-2019 |
Alan Somers <asomers@FreeBSD.org> |
[skip ci] update copyright headers in fusefs files
Sponsored by: The FreeBSD Foundation
|
#
f8ebf1cd |
| 26-Jun-2019 |
Alan Somers <asomers@FreeBSD.org> |
fusefs: implement protocol 7.23's FUSE_WRITEBACK_CACHE option
As of protocol 7.23, fuse file systems can specify their cache behavior on a per-mountpoint basis. If they set FUSE_WRITEBACK_CACHE in
fusefs: implement protocol 7.23's FUSE_WRITEBACK_CACHE option
As of protocol 7.23, fuse file systems can specify their cache behavior on a per-mountpoint basis. If they set FUSE_WRITEBACK_CACHE in fuse_init_out.flags, then they'll get the writeback cache. If not, then they'll get the writethrough cache. If they set FOPEN_DIRECT_IO in every FUSE_OPEN response, then they'll get no cache at all.
The old vfs.fusefs.data_cache_mode sysctl is ignored for servers that use protocol 7.23 or later. However, it's retained for older servers, especially for those running in jails that lack access to the new protocol.
This commit also fixes two other minor test bugs: * WriteCluster:SetUp was using an uninitialized variable. * Read.direct_io_pread wasn't verifying that the cache was actually bypassed.
Sponsored by: The FreeBSD Foundation
show more ...
|