[haiku-development] [BFS FUSE] removing the myfs folder

  • From: Jeroen Oortwijn <oortwijn@xxxxxxxxx>
  • To: haiku-development@xxxxxxxxxxxxx
  • Date: Sat, 16 Apr 2011 19:00:40 +0200

Currently, the BFS FUSE module uses rootfs and a folder named myfs to
mount the BFS volume in. This has the effect that when you mount and
open the volume, you will only see a folder named myfs - the contents
of the volume are in that folder.

To remove the need for the myfs folder, I removed the use of rootfs
and let the module mount the BFS volume in root [1]. To my surprise
this worked like expected.

The only problem is how to unmount this volume. The original code [2]
sets the current working directory to root and then unmounts the myfs
folder. With my modifications [1], it tries to unmount the root folder
and that results in a "Device or resource busy" error. Passing the
FSSH_B_FORCE_UNMOUNT flag to _kern_unmount() causes it to loop forever
(presumably due to [3]). Removing _kern_setcwd() causes it to
segfault.

Is there a way to unmount the volume?

- Jeroen

[1] http://dev.haiku-os.org/browser/haiku/trunk/src/tools/fs_shell/fuse.cpp
: Change kMountPoint to "/"; Remove line 86 to 107.
[2] http://dev.haiku-os.org/browser/haiku/trunk/src/tools/fs_shell/fuse.cpp#L451
[3] http://dev.haiku-os.org/browser/haiku/trunk/src/tools/fs_shell/vfs.cpp#L4757

Other related posts: