-
Notifications
You must be signed in to change notification settings - Fork 158
Don't doubly unmount the file system when using libfuse #346
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
base: master
Are you sure you want to change the base?
Conversation
cberner
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm. Can you fix the formatting error and force push?
fuse_session_destroy already includes an unmount, so it's redundant do call both that and fuse_session_unmount. It's dangerous even, because it could race with a different process using the same mountpoint, and unmount that process's file system. This change will be more important after the next libfuse release, which will fix a similar double-unmount problem: 1287[^1]. Both this commit and [^1] are necessary to eliminate "unmounting /tmp/mnt failed: Invalid argument" warnings that appeared beginning with libfuse 3.17.0. [^1]: libfuse/libfuse#1287
|
@asomers hmm, it seems like there's an assertion failure in the tests. Do you know what's up with that? |
The assertion only triggers on Linux, which is why I didn't see it before. But it looks like it probably should be called on FreeBSD too. Digging deeper, I see that libfuse isn't unmounting that file system automatically because the fuse_session has no Maybe we need a different approach. During |
|
I must admit to being a bit ignorant of how If so, then ya skipping over the unmount code in that case sounds right. There's already a |
|
Yes, the kernel sends FUSE_DESTROY after the unmount. |
|
Is this related to #295? |
fuse_session_destroy already includes an unmount, so it's redundant do call both that and fuse_session_unmount. It's dangerous even, because it could race with a different process using the same mountpoint, and unmount that process's file system.
This change will be more important after the next libfuse release, which will fix a similar double-unmount problem: 12871.
Both this commit and 1 are necessary to eliminate "unmounting /tmp/mnt failed: Invalid argument" warnings that appeared beginning with libfuse 3.17.0.
Footnotes
https://github.com/libfuse/libfuse/pull/1287 ↩ ↩2