Skip to content
FUSE bindings for Go
Go Other
Latest commit bd746dd May 29, 2016 @rfjakob rfjakob nodefs: lock early on FORGET
Taking the treeLock after inodeMap.Forget() exposed a
small window where the Inode that is about to be forgotten
could be handed out to the kernel under a new node ID.

Testing with fsstress for 1.000+ iterations showed that the
race can actually be hit, and causes "No such file or directory"

With the lock taken earlier, loopbackfs passes 10.000+ fsstress

Change-Id: Ic02ae757d9a726ece01e8f0b3f0ff877f8e2dbc3


GO-FUSE: native bindings for the FUSE kernel module.


* High speed: as fast as libfuse using the gc compiler for single
threaded loads.

* Supports in-process mounting of different FileSystems onto
subdirectories of the FUSE mount.

* Supports 3 interfaces for writing filesystems:
  - PathFileSystem: define filesystems in terms path names.
  - NodeFileSystem: define filesystems in terms of inodes.
  - RawFileSystem: define filesystems in terms of FUSE's raw
  wire protocol.

* Both NodeFileSystem and PathFileSystem support manipulation of true

* Includes two fleshed out examples, zipfs and unionfs.


* examples/hello/hello.go contains a 60-line "hello world" filesystem

* zipfs/zipfs.go contains a small and simple read-only filesystem for
  zip and tar files. The corresponding command is in example/zipfs/
  For example,

    mkdir /tmp/mountpoint
    example/zipfs/zipfs /tmp/mountpoint &
    ls /tmp/mountpoint
    fusermount -u /tmp/mountpoint

* zipfs/multizipfs.go shows how to use in-process mounts to
  combine multiple Go-FUSE filesystems into a larger filesystem.

* fuse/loopback.go mounts another piece of the filesystem.
  Functionally, it is similar to a symlink.  A binary to run is in
  example/loopback/ . For example

    mkdir /tmp/mountpoint
    example/loopback/loopback -debug /tmp/mountpoint /some/other/directory &
    ls /tmp/mountpoint
    fusermount -u /tmp/mountpoint

* unionfs/unionfs.go: implements a union mount using 1 R/W branch, and
  multiple R/O branches.

    mkdir -p  /tmp/mountpoint /tmp/writable
    example/unionfs/unionfs /tmp/mountpoint /tmp/writable /usr &
    ls /tmp/mountpoint
    ls -l /tmp/mountpoint/bin/vi
    rm /tmp/mountpoint/bin/vi
    ls -l /tmp/mountpoint/bin/vi
    cat /tmp/writable/*DELETION*/*

* union/autounionfs.go: creates UnionFs mounts automatically based on
  existence of READONLY symlinks.

Tested on:

- x86 32bits (Fedora 14).
- x86 64bits (Ubuntu Lucid).


We use threaded stats over a read-only filesystem for benchmarking.
Automated code is under benchmark/ directory. A simple C version of
the same FS gives a FUSE baseline

Data points (Go-FUSE version May 2012), 1000 files, high level
interface, all kernel caching turned off, median stat time:

platform                    libfuse     Go-FUSE      difference (%)

Lenovo T60/Fedora16 (1cpu)  349us       355us        2% slower
Lenovo T400/Lucid   (1cpu)  138us       140us        5% slower
Dell T3500/Lucid    (1cpu)   72us        76us        5% slower

On T60, for each file we have
- Client side latency is 360us
- 106us of this is server side latency (4.5x lookup 23us, 1x getattr 4us)
- 16.5us is due to latency measurements.
- 3us is due to garbage collection.


go-fuse works somewhat on OSX. Known limitations:

* All of the limitations of OSXFUSE, including lack of support for

* OSX issues STATFS calls continuously (leading to performance

* OSX has trouble with concurrent reads from the FUSE device, leading
  to performance concerns.

* A bunch of tests under fuse/test/ fail, and the functionality they
  test for OSX is likely broken.


* Inspired by Taru Karttunen's package,

* Originally based on Ivan Krasin's


Yes, probably.  Report them through


This is not an official Google product.


Grep source code for TODO.  Major topics:

* Support for umask in Create

* Missing support for network FS file locking: FUSE_GETLK, FUSE_SETLK,


* In the path API, renames are racy; See also:

  Don't use the path API if you care about correctness.


Like Go, this library is distributed under the new BSD license.  See
accompanying LICENSE file.
Something went wrong with that request. Please try again.