Skip to content

Nine inert FUSE mount options were removed; plumb the four that name real go-fuse capabilities #180

Closed

Description

@scttfrdmn

Nine fields on internal/fuse.MountOptions and internal/fuse.Config were settable, carried yaml tags, named real-sounding FUSE capabilities, and were read by nothing. They are removed in v0.10.1 rather than left in place, because a field a caller can set to no effect is indistinguishable from a working one — the same defect class as the s3.Config fields removed earlier in the release (DisableSSL, TargetThroughput, OptimizationLevel).

Removed from MountOptions: DirectIO, KeepCache, BigWrites, MaxRead, AsyncRead, WritebackCache, SpliceRead, SpliceWrite, SpliceMove.
Removed from Config: AllowOther, DirectIO, KeepCache, BigWrites, MaxRead, MaxWrite, ReadAhead, WriteBuffer, Concurrency.

Removing the yaml tags breaks no config file. Nothing has ever decoded YAML into either struct: the only decode target is config.Configuration, whose ten top-level keys contain no FUSE section. A fuse: block in a config file was never read, and under the strict decoding added in v0.10.1 it would now be rejected outright.

Two of the nine were also not implementable as written:

  • MaxRead is not a field on go-fuse's fuse.MountOptions at all. go-fuse passes max_read as a string mount option and sets it equal to MaxWrite, so the read size is not separately settable. internal/fuse/doc.go previously justified keeping the field on the grounds that "removing a YAML key breaks existing config files" — a key no loader read.
  • BigWrites names a FUSE capability that has been unconditional since kernel 4.20.

What is worth plumbing for real

Four of the removed flags name genuine go-fuse capabilities with observable effects. Each needs the plumbing and a test that fails without it, which is the part that was missing before:

flag go-fuse mechanism what a test would assert
DirectIO FOPEN_DIRECT_IO in FileNode.Open's returned fuseFlags reads bypass the kernel page cache: a second read(2) of the same offset reaches FileHandle.Read rather than being served by the kernel
KeepCache FOPEN_KEEP_CACHE the kernel retains cached pages across open(2), so a re-open does not re-issue reads
WritebackCache fuse.MountOptions.ExplicitDataCacheControl plus the writeback capability small sequential writes coalesce into fewer, larger WRITE requests
SpliceRead / DisableSplice fuse.MountOptions.DisableSplice bytes-transferred and syscall counts, not latency

AsyncRead inverts to go-fuse's SyncRead, which is the flag that actually exists — worth exposing under the name of the field that controls it, not the one it negates.

ReadAhead, WriteBuffer, and Concurrency on Config are not in this table: the read-ahead window is configured through internal/fuse.ReadAheadConfig (see #176, #177), the write path sizes its own buffers in internal/vfs, and nothing in the FUSE layer bounds concurrency — go-fuse's MaxBackground does, and it is not what that field was named after.

Acceptance

  • Each plumbed flag reaches the go-fuse option or the returned fuseFlags it corresponds to.
  • Each has a test asserting the effect — request counts, bytes transferred, or which layer served a read — not that the field was copied. A test that checks opts.DirectMount == cfg.DirectIO would have passed on the removed code just as well, and that is why nine dead fields survived to a release.
  • internal/fuse/doc.go's configuration example lists only fields that take effect, and says so as a property of the type.

Activity

  1. added
    type: technical-debt
    priority: medium
    area: fuse
    on Aug 2, 2026
  2. added
    effort: medium
    on Aug 3, 2026
  3. scttfrdmn commented on Aug 3, 2026

    @scttfrdmn
    OwnerAuthor

    Implemented in #261. Two notes on where it departs from the issue text, both deliberate.

    sync_read, not async_read. The table above proposes exposing "the flag that actually exists" and then names AsyncRead, which is the one that doesn't — go-fuse's field is SyncRead. That is not just a spelling matter: AsyncRead is the negation, so async_read: false — the value a half-filled config file produces, and the value someone writes meaning "leave this alone" — is the one that serializes every read. The key is sync_read, which makes the dangerous value the one an operator has to type on purpose.

    It also settles the defaults. All three fields are false by default, false is the kernel's own behavior for each, and config.NewDefault therefore names no fuse section at all — the zero value is the default, and a second place for a default to live is how the last set of these drifted.

    Two of the four are not plumbable. Both are recorded in the code at the field that would have carried them, rather than dropped in silence:

    • Splice. go-fuse's trySplice type-asserts the ReadResult to a seekable or stateful result and bails otherwise. FileHandle.Read returns fuse.ReadResultData at all four of its return sites, because the bytes come from S3 or from an in-memory cache — there is no fd to splice from. DisableSplice would disable a path this filesystem never takes: a config key whose effect is provably nothing.
    • The writeback cache. It maps to fuse.MountOptions.ExplicitDataCacheControl, which per go-fuse's own documentation makes the filesystem "fully responsible for invalidating data cache." Grepping NotifyContent|NotifyEntry|NotifyInval across this repository returns zero hits, so enabling it would convert bounded staleness into permanent staleness. (There is no WritebackCache field on fuse.MountOptions at all, and CAP_WRITEBACK_CACHE appears only in go-fuse's own types and printer — never set.)

    Acceptance, item by item:

    • Each plumbed flag reaches the option or fuseFlags it corresponds to. direct_io → FOPEN_DIRECT_IO and keep_cache → FOPEN_KEEP_CACHE from FileSystem.openFlags, returned by both Open and Create; sync_read → fuse.MountOptions.SyncRead. direct_io wins if both open-time flags are set, rather than the two being OR'd — they are contradictory instructions and the kernel's response to both is not a thing to leave to the kernel.

    • Each has a test asserting the effect, not the copy. This is the criterion that shaped the change. The kernel-facing assertions go through fs.NewNodeFS, whose rawBridge.Open copies a node's fuseFlags into the OpenOut the kernel receives, so a mount-free test reads the actual kernel-facing value. The kernel's half — whether a second read(2) at the same offset arrives, whether pages survive open(2) — needs /dev/fuse, so it is behind a fuse_mount build tag with a make test-fuse-mount target, counting READ requests rather than timing anything. Those fail rather than skip when the device is absent, because a test that skips itself reports success, and CI compiles the tag it cannot run (tests: four build tags carry code nothing compiles, and three of them are broken #240 is the general version of that).

      SyncRead is the one honest exception, and it is labeled as such in the test. go-fuse converts it to DisabledCapabilities |= CAP_ASYNC_READ inside MountOptions.setDefaults, which is unexported and which NewServer runs on a private copy; Server.KernelSettings() returns the kernel's INIT request, not the server's reply. The derived mask is unreachable from a test without a mount, so the seam test checks the copy and says why.

    • doc.go lists only fields that take effect, as a property of the type. Done, and the two unplumbable flags are named there with the reason, so the absence reads as a decision rather than an oversight.

    Each of the four seams was verified by mutation — the mapping deleted or reverted to v0.10.0's actual code, and the intended test watched to fail with its intended message:

    mutation result
    openFlags() → the literal 0, 0 that shipped 4 subtests fail
    the three assignments deleted from Adapter.buildMountOptions 3 subtests fail — and passed the whole package before the test existed
    the platform.go copy deleted 2 subtests fail
    yaml:"fuse" → yaml:"-" TestLoadFromFileReadsTheFUSESection fails

    That third row is the whole issue in miniature. The mapping lived inside Adapter.Start as a struct literal, where nothing short of a live mount could observe it — which is why it is now a method, and why nine fields could be settable and inert through a release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area: fuseeffort: mediumpriority: mediumtype: technical-debt

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions