Git Product home page Git Product logo

Comments (12)

billziss-gh avatar billziss-gh commented on June 2, 2024 1

Any idea why the filehandle is invalid in the Getattr call?

This is by design. Getattr may be called with or without a file handle. You can identify the no file handle case by checking whether fh == ^uint64(0).

from cgofuse.

billziss-gh avatar billziss-gh commented on June 2, 2024

Is the problem that data is written twice over the same range or is the problem that erroneous data are being written?

If the former, this is legal. The OS does not provide any guarantees about the order that writes will arrive at your file system.

If you want to have better control over the writes you must use open/O_DIRECT on Linux and fnctl/F_NOCACHE on OSX.

from cgofuse.

aloknerurkar avatar aloknerurkar commented on June 2, 2024

The former is happening although this is not the problem. I just wanted to make sure this is legal.

The problem happens when I get the write for 0s. And it's almost always offset 0-64k. You should be able to reproduce it if you run the test with count 5/10.

from cgofuse.

billziss-gh avatar billziss-gh commented on June 2, 2024

Yes, this is legal. You should not expect any particular order for writes when doing cached I/O.

from cgofuse.

aloknerurkar avatar aloknerurkar commented on June 2, 2024

Yes, this is legal. You should not expect any particular order for writes when doing cached I/O.

So this is not a problem. The write for 0s for the first 64k bytes is the main problem. It's always the 0-64k offsets as i mentioned. Any idea why this could happen?

from cgofuse.

billziss-gh avatar billziss-gh commented on June 2, 2024

The write for 0s for the first 64k bytes is the main problem.

Is your test/application writing something other than zeroes in the range 0-64K and the OS sends you zeroes instead?

Or is your test/application writing at offset 4702208 onward, thus creating a hole from 0-4702208 (which conceptually contains zeroes)?

from cgofuse.

aloknerurkar avatar aloknerurkar commented on June 2, 2024

So the write for 0-64k comes much later. At this point the initial writes have already happened. So basically, after the 4702208 offset, it would send this. This write overwrites the first 64k bytes to 0. The application/test is not sending this.

from cgofuse.

aloknerurkar avatar aloknerurkar commented on June 2, 2024

I ran the test by logging all the write ops I get from fuse. Attaching the logs here. So when I was testing the other day I was seeing 64k, but now I am seeing bigger values.

If you check the logs, around L935 is when the problem surfaces. This happens after the writes for the initial offsets have been completed already. I see these write ops which zero out some parts of the file. These are definitely not coming from the tests as in the test it writes the file sequentially with random bytes.

the log line can be read as write <file path> <offset> <file handle> <length of write buf> <first 10 bytes of buf>

log.txt

from cgofuse.

aloknerurkar avatar aloknerurkar commented on June 2, 2024

@billziss-gh So any more pointers on this? Were you able to check the logs?

from cgofuse.

billziss-gh avatar billziss-gh commented on June 2, 2024

If you are getting writes that overwrite legitimate data in macOS my suggestion would be to follow up on the OSXFUSE repo. Cgofuse is a thin layer around different FUSE libraries and would not introduce writes of its own.

from cgofuse.

asabya avatar asabya commented on June 2, 2024

We are seeing something like this I suppose.

from cgofuse.

aloknerurkar avatar aloknerurkar commented on June 2, 2024

@asabya This is exactly what is happening. Seems like in between the writes, we are getting Getattr call which doesn't have a valid filehandle populated even though the file is open.

@billziss-gh Any idea why the filehandle is invalid in the Getattr call?

I think we can close this issue.

from cgofuse.

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.