Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 8 Jan 2007 11:19:38 -0500
From:      John Baldwin <jhb@freebsd.org>
To:        freebsd-arch@freebsd.org
Cc:        Poul-Henning Kamp <phk@phk.freebsd.dk>, Ed Schouten <ed@fxq.nl>
Subject:   Re: Request for PTY/devfs changes
Message-ID:  <200701081119.39163.jhb@freebsd.org>
In-Reply-To: <20070106213651.GD46094@hoeg.nl>
References:  <20070106191401.GC8574@heave.ugcs.caltech.edu> <10319.1168112909@critter.freebsd.dk> <20070106213651.GD46094@hoeg.nl>

next in thread | previous in thread | raw e-mail | index | archive | help
On Saturday 06 January 2007 16:36, Ed Schouten wrote:
> * Poul-Henning Kamp <phk@phk.freebsd.dk> wrote:
> > It doesn't even work to send a "this if for a create" flag along
> > for the dev_clone, because another process might race in and do
> > something silly before we get to that level.
> 
> Sorry - I can't quite understand this. You mean a situation where two
> threads perform an open() on the same filename at the same time could
> cause two pty's to be allocated with the same name? But how is that
> covered at this moment when two threads perform a stat() or open() at
> the same time?

devfs doesn't seem to handle any of this for you at all, forcing each bit
of code that uses dev_clone to manage all this itself. :(  When a device
is opened you can mark it as opened.  Perhaps you can have a callout that
periodically checks to see if there are any "orphans" created due to a
stat() and if so schedule a task on a taskqueue to purge them.  I need to
figure out something sane for /dev/ipmi0 before I can turn on cloning
there myself.

-- 
John Baldwin



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200701081119.39163.jhb>