tech-kern archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: unmounting all filesystems (was Re: CVS commit: src/sys)



On Mon, Apr 20, 2009 at 07:13:18PM -0500, David Young wrote:
 > > Hmm. What problem are you trying to solve? Note that MNT_FORCE is being
 > > used. If it's not used we still have at least init to worry about, and the
 > > kernel itself can maintain vnode refs, like its cwdinfo or an accounting
 > > file.
 > 
 > I am trying to tear down arbitrary stacks of block pseudo-devices and
 > filesystems.
 > [...]
 >
 > It is important to unmount *only* the filesystem at the *top* of a stack
 > such as this one,
 > 
 >         filesystem: /dev/vnd0a at /x/y/z
 >         disk: vnd0 at /q.img
 >         filesystem: / at wd0a
 > 
 > before trying to all of the detach devices again.

I am not convinced this can be done without building a dependency
graph, and I doubt the information can be extracted as things stand.

I would in general support collecting and maintaining this information
at runtime, but it wouldn't exactly be trivial to set up. Especially
since processes can participate in the graph in meaningful ways (e.g.
userland NFS servers mounted via loopback...)

 > Maybe CIRCLEQ_LAST(&mountlist) is always the top filesystem, but I have
 > my doubts.

If nothing ever reorders the list it must be, but I dunno if that's a
good property to assume. Better than guessing randomly, I suppose.

-- 
David A. Holland
dholland%netbsd.org@localhost


Home | Main Index | Thread Index | Old Index