[Top][All Lists]

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

Re: settrans --chroot

From: Roland McGrath
Subject: Re: settrans --chroot
Date: Mon, 27 May 2002 14:14:20 -0400 (EDT)

> On Sat, May 04, 2002 at 06:58:59PM -0400, Roland McGrath wrote:
> > I suspect that presently if you use this (assuming settrans works right),
> > that the filesystem process will stick around after the command finishes
> > and you might have to kill it.
> Indeed, this is what happens.
> > If that happens, we should clean up the
> > filesystem code so that it gracefully notices when there are live no
> > control ports and no live node ports, and exits. 
> Is this hard to do?

It should not be.  I think at least some of the filesystems already do it
(e.g. diskfs_shutdown) when the libports thread timeouts all go.  But those
timeouts are set to large values (minutes).  We could make the destructors
(port class cleanup fn) check the number of live ports and clean up
immediately when there are none.  diskfs already keeps track of
_diskfs_ncontrol_ports (for no apparent reason), so it's easy to check that.

In the usual case, all the protid ports would be gone before the control
port went.  So just checking in the control port class cleanup fn for
remaining protids with ports_count_class would suffice.  But in the
settrans --chroot case, it will be the opposite.  In that case, the protid
destructor would need to do something for a timely exit to happen.
In diskfs, we could have diskfs_nput maintain a live-nodes count and
trigger the check when it hits zero.  That would be easy and low-cost.
The check itself needs to use the count/inhibit calls (see diskfs_shutdown)
to synchronize with any new ports appearing while it's checking.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]