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 Sun, Apr 26, 2009 at 08:44:17AM +0000, David Holland wrote:
> 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 am trying to avoid building a full dependency graph. think that
I ordinarily the "leaves" of the graph are clear.

> 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...)

An illustrative example may help here.

>  > 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.

Greg Oster suggests using/adding a time-mounted timestamp to decide
which filesystem to unmount.

Dave

-- 
David Young             OJC Technologies
dyoung%ojctech.com@localhost      Urbana, IL * (217) 278-3933


Home | Main Index | Thread Index | Old Index