winfsp / cgofuse

Cross-platform FUSE library for Go - Works on Windows, macOS, Linux, FreeBSD, NetBSD, OpenBSD
https://winfsp.dev
MIT License
527 stars 84 forks source link

Use -z with fusermount to allow unmount if mount is busy #10

Closed ncw closed 7 years ago

ncw commented 7 years ago

This is arguably the same as MNT_FORCE as used in the other cases.

Without this when stuff goes wrong in my unit tests I have to manually fusermount -z -u the mount

billziss-gh commented 7 years ago

Looks good although we should also change the umount2 call to also do MNT_DETACH rather than MNT_FORCE for symmetry.

billziss-gh commented 7 years ago

~Testing with this change on my local Linux VM does not seem to unmount at all when the mount point is in use.~

$ uname -a
Linux elementary 4.4.0-72-generic #93-Ubuntu SMP Fri Mar 31 14:07:41 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux
$ fusermount -V
fusermount version: 2.9.4

Actually scratch that. User error. Sorry.

billziss-gh commented 7 years ago

Commit bf82edeb6cb41f1c73be0046008e5d4902be8ac0 also changes MNT_FORCE to MNT_DETACH when trying to unmount the file system with umount2.

BTW, I added a Contributors section to the README and added your name there. Please let me know if you are uncomfortable with that decision and I will have it removed. Commit b1c139c5b1c6cdb66e481f8b8a8c7112065d554b.

ncw commented 7 years ago

I added a Contributors section to the README and added your name there. Please let me know if you are uncomfortable with that decision and I will have it removed.

I'm honored to be there :-)