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

Race condition between bindfs exit and filesystem actually being mounted #131

Closed
slonopotamus opened this issue Jul 9, 2023 · 5 comments
Labels
fuse-bug Most likely a bug in a FUSE implementation mac-os

Comments

@slonopotamus
Copy link
Contributor

slonopotamus commented Jul 9, 2023

Way to reproduce:

mkdir aa
mkdir bb
bindfs aa bb && umount bb

There's a very high chance that you'll get umount: bb: not currently mounted

Another way to reproduce, more realistic (this is what I actually hit - trying to access files right after mounting them):

mkdir aa
touch aa/file
mkdir bb
bindfs aa bb && ls bb/file

There's a very high chance that you'll get ls: bb/file: No such file or directory

Is there any way to guarantee that by the time bindfs returns non-zero exit code filesystem is actually mounted?

My environment:

  • macOS Ventura on M1
  • bindfs 1.17.3
  • fuse-t 1.0.23

Adding sleep 1 after bindfs exit workarounds the issue, but doesn't look like a proper fix.

@mpartel mpartel added mac-os fuse-bug Most likely a bug in a FUSE implementation labels Jul 9, 2023
@mpartel
Copy link
Owner

mpartel commented Jul 9, 2023

This is almost certainly a fuse-t issue. Bindfs hands over to the FUSE library (provided by fuse-t in this case) here, and the FUSE library handles backgrounding the process.

I can't think of a reasonable workaround to implement in bindfs. As a tedious workaround in your scripts, you might be able to poll the system's list of mounts (not sure where it is on MacOS), though it might appear too early there as well.

Closing this, but feel free to reopen if you think I'm wrong.

@mpartel mpartel closed this as completed Jul 9, 2023
@slonopotamus
Copy link
Contributor Author

No problem, I'll open a similar bug report in fuse-t. From a user PoV, it is pretty hard to understand which part of the system is causing the issue)

@slonopotamus
Copy link
Contributor Author

Reported to fuse-t: macos-fuse-t/fuse-t#29

@mpartel
Copy link
Owner

mpartel commented Jul 9, 2023

Thanks!

From a user PoV, it is pretty hard to understand which part of the system is causing the issue)

True, and this is the logical place to ask first. Sorry if I came across as implying otherwise.

@slonopotamus
Copy link
Contributor Author

BTW, confirming that this issue does NOT reproduce with macFUSE 4.5.0, that hints that it is fuse-t to blame.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
fuse-bug Most likely a bug in a FUSE implementation mac-os
Projects
None yet
Development

No branches or pull requests

2 participants