Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix issue when reading directory with many entries #28

Merged
merged 1 commit into from
Feb 17, 2016

Conversation

greenboxal
Copy link
Contributor

By some reason reading a directory with many entries(1000+) caused an EIO(-5) error.

Letting libfuse manage the readdir offsets fixed the issue.

@mpartel
Copy link
Owner

mpartel commented Jan 19, 2016

Hmm, I can't reproduce this. I tried writing a test like this but it passed. This is on Ubuntu 14.04.

  • Does that test pass or fail for you, if you add it to tests/test_bindfs.rb?
  • What OS and version of FUSE are you using?
  • Does the problem only occur with specific flags?
  • Which program is failing to read the directory? (does ls fail?)

@chrisenytc
Copy link

👍 I have the same problem

@greenboxal
Copy link
Contributor Author

Maybe this only occurs with specific backing filesystems.

I'm using bindfs to mount a path inside an AFS mount. I can access everything in AFS, including the same directory that gives me problems when mounted with bindfs.

Is there any harm in letting FUSE manage readdir offsets? If not, even this is a extreme edge case with specific filesystems, I don't see any harm in merging it.

@mpartel
Copy link
Owner

mpartel commented Jan 19, 2016

Ok, that's strange.

Assuming FUSE works the way the API suggests it does, and given that bindfs is single-threaded by default, the downside of this change is that it makes the entire directory scan an O(n) blocking operation that prevents other simultaneous operations from going through. I don't think most users would notice a difference, but it might well be a nontrivial regression for some users with huge directories.

Sorry, I'm hesitant to merge this without additional information, since it sounds like the bug might really be in AFS or FUSE. If you can't find any additional information but still want to upstream this change, I'm open to adding it as an optional flag.

@ghostwheel
Copy link

I had a similar problem, in android running debian linux in chroot, and mounting a fat32 mounted dir
again mapped user. bindfs wouldn't read the whole dir, and the hack above fixed the problem.

@mpartel mpartel merged commit ba628e6 into mpartel:master Feb 17, 2016
@mpartel
Copy link
Owner

mpartel commented Feb 17, 2016

Ok, I suppose this affects enough people to be worth changing, although I still can't reproduce this, even on fat32 :/

Merged and released as 1.13.1.

Thanks all for reporting!

@mpartel mpartel mentioned this pull request Feb 17, 2016
mpartel added a commit that referenced this pull request Sep 25, 2016
A regression was introduced in bindfs 1.13.1 with the fix
(or rather, workaround) for #28. FUSE's contract for readdir
says that if `filler` is passed a zero offset then the readdir
implementation should ignore the offset parameter, but we didn't.

Fixes #39.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants