From: Jeffrey L. <la...@re...> - 2007-07-12 17:20:57
|
On Thu, 2007-07-12 at 18:43 +0200, Jan Engelhardt wrote: > On Jul 12 2007 10:34, Jeffrey Law wrote: > > > >I've been working with funionfs+FUSE to implement overlayed r/w > >directories on top of a readonly root filesystem. Everything works > >well except for one issue. > > > >Specifically, if one tries to mount a FUSE based filesystem on top > >of /etc you can lock the FUSE mounting process and any process which > >attempts to read /etc. > > > >As best as I can tell, the mount succeeds (do_mount), but fusermount > >hangs as soon as we try to update the mtab file (via add_mount). > > > >This can obviously be avoided by IGNORE_MTAB at compile time. However, > >that means that we will have no record of any FUSE mounted filesystems > >in /etc/mtab. > > > >What would be much better would be a "-n" option to dynamically > >select between updating mtab (default) or not updating mtab. That > >would bring FUSE-mount into line with most of the other mount > >programs which support a -n option. > > What would be best is, if fuse did something along the lines of... > > int main(...) > { > /* do this early */ > etc_fd = open("/etc", O_DIRECTORY); > } > > int play_with_mtab(...) > { > int fd = openat(etc_fd, "mtab", O_RDWR, ...); > } I don't really see how this helps. We don't muck with mtab until after do_mount has completed, or are you suggesting that "play_with_mtab" happen even later?. I must be missing something (not being terribly familiar with FUSE doesn't help :-) It's also not going to work well with the existing glibc API for manipulating the mtab file. They expect you to just pass in a pathname to setmntent rather than an fd or FILE * Jeff |