From owner-freebsd-current@FreeBSD.ORG Mon Jul 2 04:20:41 2007 Return-Path: X-Original-To: current@freebsd.org Delivered-To: freebsd-current@FreeBSD.ORG Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 5B0BD16A46C for ; Mon, 2 Jul 2007 04:20:41 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: from harmony.bsdimp.com (bsdimp.com [199.45.160.85]) by mx1.freebsd.org (Postfix) with ESMTP id 19BCE13C43E for ; Mon, 2 Jul 2007 04:20:41 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: from localhost (localhost [127.0.0.1]) by harmony.bsdimp.com (8.13.8/8.13.4) with ESMTP id l624IUN1004720; Sun, 1 Jul 2007 22:18:30 -0600 (MDT) (envelope-from imp@bsdimp.com) Date: Sun, 01 Jul 2007 22:19:11 -0600 (MDT) Message-Id: <20070701.221911.1394573729.imp@bsdimp.com> To: nate@root.org From: "M. Warner Losh" In-Reply-To: <4688791D.6050007@root.org> References: <46880F1C.3020602@root.org> <20070701.215557.1373430453.imp@bsdimp.com> <4688791D.6050007@root.org> X-Mailer: Mew version 5.2 on Emacs 21.3 / Mule 5.0 (SAKAKI) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-2.0 (harmony.bsdimp.com [127.0.0.1]); Sun, 01 Jul 2007 22:18:30 -0600 (MDT) Cc: marck@rinet.ru, current@freebsd.org Subject: Re: GEOM weirdness with SD flash reader? X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 02 Jul 2007 04:20:41 -0000 In message: <4688791D.6050007@root.org> Nate Lawson writes: : M. Warner Losh wrote: : > In message: <46880F1C.3020602@root.org> : > Nate Lawson writes: : > : Yes, you're exactly right. However, shouldn't a read from a device : > : trigger a re-taste if the media is removable? : > : > I don't think it does. The driver is expected to poll, however... : > : > : So the fdisk of da2 : > : should have caused it to re-read the MBR and create /dev/da2s1. I think : > : maybe there should be a flag set for devices with removable media that : > : causes the device to be re-tasted on every mount request. : > : > Is there even a removable flag to disks? : : In SCSI there is, removable flag combined with medium not present: : : da2 at umass-sim1 bus 1 target 0 lun 2 : da2: Removable Direct Access SCSI-0 device : ^^^^^^^^^ : da2: 40.000MB/s transfers : da2: Attempt to query device size failed: NOT READY, Medium not present I think you've misunderstood my point. I know that SCSI has this flag, but I can't find anything in GEOM that it would map to. It seems a common enough situation that having such a flag in GEOM would be beneficial and easy to implement. : What if we kicked off a thread to run every 3 seconds that did a quick : poll of such devices and sent a devd notify if they arrived (i.e. medium : present)? It wouldn't work for floppy drives, but we could make this : part of the da driver or something in usermode like devd itself calling : camcontrol? In the past, people have said that polling messes up multimedia access, so it hasn't happened. But wouldn't a simple daemon in userland do the same thing? Or parsing the output of camcontrol inquiry? Camcontrol rescan is a nop for these devices. Warner