Re: Devd event from GEOM?

From: Robert Watson <rwatson_at_freebsd.org>
Date: Tue, 25 Jan 2005 14:54:29 +0000 (GMT)
On Tue, 25 Jan 2005, Poul-Henning Kamp wrote:

> In message <20050125.073258.94555150.imp_at_bsdimp.com>, "M. Warner Losh" writes:
> 
> >: So suppose I'm listening to a devd socket to try and identify storage
> >: devices arriving that I can automount.  How do I know which device
> >: announcements are for storage devices?
> >
> >Hmmmm, once upon a time I'd have said 'stat the device, and you know'
> >since those would be block devices....
> 
> We do actually have an ioctl, FIODTYPE, which will tell you the "kind"
> of device, but that requires you to open it (O_NDELAY will do) 

However, many device nodes can only be opened "exclusively", security
event auditing will occur, or opening will have side effects.  Opening a
device node to find out what type it is currently seems not to work very
well and/or be undesirable.

> >The trouble is that we don't
> >know at that level either, yet when the GEOM even happens, how can we
> >be sure that we win that race?
> 
> There is no way you can win the race.  The device may already be gone
> again by the time you hear about the event. 
> 
> Welcome to the world of dynamic hardware. 

While you could imagine user space controlling the stepping of exposed
device nodes to prevent inconsistency, it's similarly easy to imagine the
potential feedback loops, deadlocks, etc, that would occur.  Given that we
already mediate use of the /dev name space, I think we have to be able to
rely on sane use of that space: if ad0 is replaced almost immediately by
ad0, it shouldn't really matter which you get, at least in as much as that
the consumer can figure out if it happened (should it matter, which I
suspect in most cases it won't). 

Robert N M Watson
Received on Tue Jan 25 2005 - 13:54:57 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:38:26 UTC