Comments (4)
I've come across an oddity with Readdir which I'm not sure of the cause - I think it may be an OpenBSD bug but it might be a cgofuse bug so I thought I'd ask you first.
Yes, this looks odd.
This causes a problem for rclone since it checks to see that Readdir is never called with a non-zero offset which it never should be as it always passes 0 as an offset to the fill function. This is easy enough to work-around but I thought I'd report it in case it is indicative of an underlying problem.
I agree that you should not see a non-0 offset in Readdir
, if you never pass a non-0 offset to the fill
function.
In the Linux/FreeBSD/macOS case it is actually libfuse that makes this guarantee: the kernel protocol always includes the offset in the FUSE_READDIR
request message, but libfuse abstracts this detail away by buffering readdir
data, when it sees a 0 offset and satisfying the FUSE_READDIR
request from the buffered data when it sees a non-0 offset. (Libfuse only does this buffering when you specify 0 offsets in the fill
function.) See the libfuse fuse_readdir_common
.
The cgofuse Readdir
implementation is minimal and the same across all cgo platforms. So I suspect (but may be wrong) that in this case the problem lies with OpenBSD's implementation. I note that OpenBSD does not use libfuse.
from cgofuse.
Here is the readdir
implementation of OpenBSD's libfuse, which appears to pass the kernel's view of the offset:
It appears to me that this is a problem with OpenBSD.
from cgofuse.
Thank you for your analysis Bill.
I finally found the docs for the fill behaviour in the libfuse docs
So what it looks like is that OpenBSD libfuse equivalent doesn't implement this behavior
- The readdir implementation ignores the offset parameter, and passes zero to the filler function's offset. The filler function will not return '1' (unless an error happens), so the whole directory is read in a single readdir operation.
@SylvestreG - I think you wrote this code originally. Does that sound right to you?
@lkostal - as the most recent OpenBSD user to be interested in this, do you want to report this as a bug?
from cgofuse.
Just wanted to corroborate that I'm experiencing this as well.
I took some notes during testing an implementation. Noticed an oddity when using NetBSD and OpenBSD.
https://gist.github.com/djdv/8341762e571ef799cf7613f2f3c1f506#netbsd
This lists some of the various versions I tried and has a small trace.
from cgofuse.
Related Issues (20)
- On macOS, under load, files appearing twice or disappearing when running `ls`, unless `readdir` is sorted HOT 14
- Occasional crash under Windows - use after free? HOT 9
- . HOT 1
- Write method not called HOT 1
- Enable LOCK feature HOT 2
- How to increase buffer size? (max_pages and libfuse3) HOT 1
- Mount and Unmount Result
- Mixup of O_EXCL and O_TRUNC constant values CGO vs non CGO HOT 13
- warning: "FUSE_USE_VERSION" redefined HOT 1
- possible to call cheat engine with cgofuse HOT 1
- Support ARM architecture on Linux
- Incorrect writes from fuse HOT 12
- Need to know when the fuse service is ready HOT 4
- Please provide a way to retrieve information about the fuse implementation
- memfs example problems
- Golang Windows Passthrough version HOT 1
- command line options for Memfs HOT 8
- How can I not let it download video/image files automatically? HOT 3
- Mirrorfs? HOT 2
- Possibility to render folder asynchronously with Readdir HOT 11
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from cgofuse.