From owner-freebsd-arch@FreeBSD.ORG Thu Sep 18 11:23:44 2003 Return-Path: Delivered-To: freebsd-arch@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 59E6C16A4B3; Thu, 18 Sep 2003 11:23:44 -0700 (PDT) Received: from harmony.village.org (rover.bsdimp.com [204.144.255.66]) by mx1.FreeBSD.org (Postfix) with ESMTP id 4D86743F85; Thu, 18 Sep 2003 11:23:41 -0700 (PDT) (envelope-from imp@bsdimp.com) Received: from localhost (warner@rover2.village.org [10.0.0.1]) by harmony.village.org (8.12.9/8.12.3) with ESMTP id h8IINeTX006396; Thu, 18 Sep 2003 12:23:40 -0600 (MDT) (envelope-from imp@bsdimp.com) Date: Thu, 18 Sep 2003 12:23:42 -0600 (MDT) Message-Id: <20030918.122342.129340232.imp@bsdimp.com> To: rwatson@freebsd.org From: "M. Warner Losh" In-Reply-To: References: <20030918.121507.32721201.imp@bsdimp.com> X-Mailer: Mew version 2.2 on Emacs 21.3 / Mule 5.0 (SAKAKI) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit cc: bms@spc.org cc: phk@phk.freebsd.dk cc: freebsd-arch@freebsd.org Subject: Re: devd limitations / automounting removable storage X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Sep 2003 18:23:44 -0000 In message: Robert Watson writes: : : On Thu, 18 Sep 2003, M. Warner Losh wrote: : : > In message: : > Robert Watson writes: : > : For ifnet events, we can use routing sockets. I don't know that we have : > : GEOM events as yet. One reason to separately handle GEOM from devfs would : > : be that GEOM "objects" tend to be storage devices or related notions, : > : whereas devfs entries could be any number of things. : > : > While this is true, one can ask a /dev entry what kind of object it is. : > Since one can do that, one can construct filters that will only do : > things for storage objects. : : Opening a device to ask it what it might be is generally a bad idea -- you : can block other consumers from using the device (and related devices), : cause a variety side-effects, etc. Also, I'm not clear that you can get a : useful result using open/fstat/stat/ioctl to figure out what something is : without apriori knowledge of device numbers, and even then the utility is : limited. If you have a network layer announcement "Hey, this interface : arrived", then there's no question that it's a network interface. You don't need to open the device to know what it is in many cases. You know you have a potential mount point with a simple stat of the device. If you open the device, there's nothing more than you can learn from it than you can from stat, unless you go the "I'm going to try this non-destrictuve ioctl and hope for the best" approach. Tape drives are a big category of side effects from open. Few other devices have any meaningful side effects from opening them, but they do exist. Warner