[Bug 236340] [FUSE] fuse(4) should pass through O_APPEND to the filesystem daemon

bugzilla-noreply at freebsd.org bugzilla-noreply at freebsd.org
Wed Mar 6 23:07:53 UTC 2019


https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=236340

            Bug ID: 236340
           Summary: [FUSE] fuse(4) should pass through O_APPEND to the
                    filesystem daemon
           Product: Base System
           Version: CURRENT
          Hardware: Any
                OS: Any
            Status: New
          Severity: Affects Many People
          Priority: ---
         Component: kern
          Assignee: bugs at FreeBSD.org
          Reporter: asomers at FreeBSD.org

Currently when you open a fuse-backed file with O_APPEND, the kernel hides the
O_APPEND flag from the fuse filesystem and computes write offsets in
fuse_write_directbackend.  However, that behavior doesn't work for networked
fuse filesystems.  The problem is that two clients both writing to the same
file with O_APPEND wouldn't cooperate to update the file size.  Or to put it
another way, implementing O_APPEND in-kernel requires cacheing the file size
attribute, and cacheing attributes is not generally allowed for networked file
systems.

The libfuse documentation makes it explicit that filesystems must handle the
O_APPEND flag as of protocol 7.23.  Implicitly, filesystems should handle it on
older protocols as well.

There are two possible approaches we could take:
1) Pass O_APPEND to FUSE_OPEN and set the offset of all FUSE_WRITE operations
to 0
2) Pass O_APPEND to FUSE_OPEN but still compute the offset of all FUSE_WRITE
operations as we do currently, expecting that compliant fuse filesystems will
ignore it.

I don't know how many fuse filesystems correctly handle O_APPEND, but I bet
it's less than all of them.

-- 
You are receiving this mail because:
You are the assignee for the bug.


More information about the freebsd-bugs mailing list