Code Monkey home page Code Monkey logo

Comments (5)

zargony avatar zargony commented on May 30, 2024

Hi,
thanks for the kind words! Unfortunately, it's been some time that I worked with FUSE and I'm not sure about opening flags myself anymore. I probably would expect it to be similar to what you describe. But if it's different, this is most probably not related to rust-fuse, since rust-fuse only forwards information between the FUSE kernel driver and a useful userspace interface. People of the OSXFUSE community should know a good answer on this I suppose.

from fuse-rs.

radupopescu avatar radupopescu commented on May 30, 2024

Hi,

Sorry for the delayed reply. I wanted to do some tests before replying.

Indeed, I see that my code is working as expected on Linux, with libfuse 2.9.4. The problem exists solely with OSXFUSE. It seems that a relevant bug was fixed in FreeBSD, too:

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

This issue was reported for OSXFUSE, but was closed. Let's see what can be done there:
osxfuse/osxfuse#398

From my point of view, this issue can be closed here.

Thanks again!

from fuse-rs.

zargony avatar zargony commented on May 30, 2024

Thanks for making inquiries and for linking the related issues here.

from fuse-rs.

radupopescu avatar radupopescu commented on May 30, 2024

Unfortunately, I may have spoken too soon.

After some more tests, I see that writing works correctly with the standard fusexml_fh C example on Linux, Mac and FreeBSD.

In my own FS, written in Rust using rust-fuse, writing works correctly on Linux and FreeBSD, but still fails on macOS (OSXFUSE).

I guess there must be a problem in the way the the user-space part of rust-fuse interacts with the OSXFUSE kernel module. I have to investigate further and will open a new ticket, if needed.

Cheers!

from fuse-rs.

radupopescu avatar radupopescu commented on May 30, 2024

Finally, I found the cause of the problem. It was a misuse of the flags argument passed into the open callback and back out in the call to reply.opened(...).

Basically I was forwarding the flags in between the two. When a file was opened with O_WRONLY (==0x1), passing these flags to the reply meant that FOPEN_DIRECT_IO was set for the opened file, causing the incorrect write. That is also why this problem never manifested when opening files in read mode.

from fuse-rs.

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.