With the help of an OS X user I recently tried to add automount
support for a MacFUSE/FUSE file system (scord). However, it seems that
the instructions at http://code.google.com/p/macfuse/wiki/AUTOMOUNTING
do not quite work because of an automount-MacFUSE race:

1. initiate automount request
2. exec mount_FS
3. mount_FS internally calls fuse_main()
4. mount_FS forks
5. mount_FS child process starts mounting
5. mount_FS parent process exits and then automounter checks the mountpoint

The problem is with the two concurrent steps labeled 5: automount
appears to check that the mount succeed after the parent mount_FS
process exits, but at this point the child mount_FS process may still
be initializing the file system. And so the automount check can
incorrectly fail.

Is this problem statement correct?

Additionally, such a race has two bad side effects:
- all future mount attempts at the mountpoint will failure (until reboot)
- the MacFUSE kernel module is left with a +1 usage count (until reboot,
  of course)

A largely-working solution would be to add a short sleep (e.g., one
second) to parent FS process or to a second mount_FS that calls the
base mount_FS and then sleeps. But of course a sleep only decreases
the number of situations in which the race will surface.

It seems that the correct solution may be that the parent mount_FS
process should not exit until the mount is complete or has failed.  At
least part of this change would be to the MacFUSE FUSE library, inside
fuse_main() or a child function. FUSE on Linux does not have this
issue (it does not have such automount support afaik), but this may
also be a welcome improvement so that starting a fuse file system
process only completes when the mount attempt itself is complete.
I know that this has complicated scripting for me in the past.

thanks!
-- 
Chris Frost
http://www.frostnet.net/chris/

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"MacFUSE" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/macfuse?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to