From owner-freebsd-current@FreeBSD.ORG Mon Jul 2 22:21:39 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 43A2916A41F for ; Mon, 2 Jul 2007 22:21:39 +0000 (UTC) (envelope-from nate@root.org) Received: from root.org (root.org [67.118.192.226]) by mx1.freebsd.org (Postfix) with ESMTP id 299B113C4BB for ; Mon, 2 Jul 2007 22:21:39 +0000 (UTC) (envelope-from nate@root.org) Received: (qmail 11157 invoked from network); 2 Jul 2007 22:21:40 -0000 Received: from ppp-71-139-42-13.dsl.snfc21.pacbell.net (HELO ?10.0.5.18?) (nate-mail@71.139.42.13) by root.org with ESMTPA; 2 Jul 2007 22:21:40 -0000 Message-ID: <46897A6A.9020909@root.org> Date: Mon, 02 Jul 2007 15:21:30 -0700 From: Nate Lawson User-Agent: Thunderbird 2.0.0.4 (X11/20070617) MIME-Version: 1.0 To: Robert Watson References: <54253.1183351841@critter.freebsd.dk> <4688878F.20406@root.org> <20070701.233153.-1343615328.imp@bsdimp.com> <4688947D.4040803@root.org> <20070702150825.L61395@fledge.watson.org> In-Reply-To: <20070702150825.L61395@fledge.watson.org> X-Enigmail-Version: 0.95.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: phk@phk.freebsd.dk, marck@rinet.ru, "M. Warner Losh" , 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 22:21:39 -0000 Robert Watson wrote: > > On Sun, 1 Jul 2007, Nate Lawson wrote: > >>> : I disagree. Once scsi_da found the media, it would then somehow >>> need to >>> : notify devd (i.e. to automount). If both functions are in devd, the >>> : loop becomes: >>> : >>> : while (1) { >>> : camcontrol tur mydev; >>> : if (found) >>> : notify_automount; >>> : break; >>> : sleep 3; >>> : } >>> >>> This doesn't belong in devd. >>> >>> Robert has patches to bring new geom entries into the realm of devd. >> >> URL? > > This is from quite a long time ago, so likely needs massaging to apply. > > http://www.watson.org/~robert/freebsd/geom_devctl.diff > > The idea is straight forward: when a new geom device is discovered, we > issue a notification, which allows devd to respond to events above the > newbus layer -- i.e., discover of an fdisk partition table, swap-backed > md device, attachment of a new software RAID layer, arrival of a volume > by volume name, arrival of a ZFS volume, etc. Minor comments: * Functions are small enough that I doubt they need a whole new C file * devd string looks a little weird ("at on"?) I don't think this helps. When usb calls scsi_da calls disk_create(), userland will get a GEOM devd notice. Now what happens? I assume it might be: some script runs, does camcontrol inquiry , notes that it is removable, then forks a proc that does the above sleep loop I described? I don't think that's any different from what I described except I put it as internal to devd, not an external script. I don't care where it goes so that's fine with me. After the device is unmounted and the media potentially goes away, who figures out that the poll loop should start up again? -- Nate