Code Monkey home page Code Monkey logo

Comments (7)

hanwen avatar hanwen commented on May 18, 2024

have you tried adding the "direct_io" option to mount, https://godoc.org/github.com/hanwen/go-fuse/fuse#MountOptions?

from go-fuse.

yasker avatar yasker commented on May 18, 2024

Hi @hanwen

I tried direct_io option, but cannot figure out why it doesn't work on my setup(Ubuntu 16.04):

conn := nodefs.NewFileSystemConnector(newFs.Root(), nil)
opts := &fuse.MountOptions{
                        MaxBackground: 12,
                        Options:       []string{"direct_io"},
                }
server, err := fuse.NewServer(conn.RawFS(), fs.GetMountDir(), opts)

fusermount reports:

/bin/fusermount: mount failed: Invalid argument

And if I remove direct_io option it works.

from go-fuse.

vChrysanthemum avatar vChrysanthemum commented on May 18, 2024

try

func(fs *FS) Open(name string, flags uint32, context *fuse.Context) (nodefs.File, fuse.Status) {
        f := ...
        return &nodefs.WithFlags{
                File:      f,  
                FuseFlags: fuse.FOPEN_DIRECT_IO,
        }, fuse.OK
}

from go-fuse.

yasker avatar yasker commented on May 18, 2024

Thanks @vChrysanthemum , I've figured that out lately, but it still doesn't work for me. I am sure kernel is handling the file in direct-io mode but it somehow hangs(soft lock up) due to waiting for a page to be locked. I am still investigating.

And I saw bazil/fuse seems tested with direct_io already, so may want to give that a try as well.

from go-fuse.

yasker avatar yasker commented on May 18, 2024

Just a update: soft lock up caused by a kernel bug in FUSE interaction with loopback device. It exists after Linux v4.1. Details can be found at https://sourceforge.net/p/fuse/mailman/message/35276378/

from go-fuse.

WoolenWang avatar WoolenWang commented on May 18, 2024

having the same issue , can not support when using namazu with direct_io , it use this go-fuse lib.
@yasker
have you find out how to support this direct_io?

from go-fuse.

hanwen avatar hanwen commented on May 18, 2024

you can use directio by specifying the fuse.FOPEN_DIRECTIO flag from create or open methods.

from go-fuse.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.