Date: Tue, 25 Jan 2005 14:54:29 +0000 (GMT) From: Robert Watson <rwatson@freebsd.org> To: Poul-Henning Kamp <phk@phk.freebsd.dk> Cc: "M. Warner Losh" <imp@bsdimp.com> Subject: Re: Devd event from GEOM? Message-ID: <Pine.NEB.3.96L.1050125145130.3036B-100000@fledge.watson.org> In-Reply-To: <85367.1106664286@critter.freebsd.dk>
next in thread | previous in thread | raw e-mail | index | archive | help
On Tue, 25 Jan 2005, Poul-Henning Kamp wrote: > In message <20050125.073258.94555150.imp@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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.NEB.3.96L.1050125145130.3036B-100000>