Bug 236378 - [FUSEFS] fuse must set FUSE_WRITE_CACHE when writing from the page cache
Summary: [FUSEFS] fuse must set FUSE_WRITE_CACHE when writing from the page cache
Status: Closed FIXED
Alias: None
Product: Base System
Classification: Unclassified
Component: kern (show other bugs)
Version: CURRENT
Hardware: Any Any
: --- Affects Many People
Assignee: Alan Somers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-03-07 23:17 UTC by Alan Somers
Modified: 2019-09-15 04:47 UTC (History)
2 users (show)

See Also:
asomers: mfc-stable12+


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Alan Somers freebsd_committer freebsd_triage 2019-03-07 23:17:27 UTC
FUSE operations all record the pid, uid, and gid of the requesting process.  Many FUSE filesystem daemons use that to authenticate accesses.  Ideally, they would only do it on FUSE_OPEN.  But may daemons are internally stateless, which requires them to authenticate operations on every operation, including FUSE_WRITE.

However, writes that come from the page cache (such as when a fuse-backed file is mmap()ed or when using the writeback caching strategy introduced in protocol 7.23) cannot set these fields correctly, because multiple processes may have written to the same file.  For such cases, FUSE_WRITE defines the FUSE_WRITE_CACHE flag, which indicates to the filesystem daemon that these fields are not valid.

fuse(4) must set this flag when issueing writes from the cache.
Comment 1 Conrad Meyer freebsd_committer freebsd_triage 2019-03-07 23:52:31 UTC
Might be more specific to say "fuse should set this flag when the initiating pid/uid/gid is no longer associated with the write."
Comment 2 Alan Somers freebsd_committer freebsd_triage 2019-06-03 17:16:34 UTC
Fixed by r348313