From owner-freebsd-stable@FreeBSD.ORG Sat Feb 25 07:13:50 2012 Return-Path: Delivered-To: freebsd-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D1C231065673; Sat, 25 Feb 2012 07:13:50 +0000 (UTC) (envelope-from nox@jelal.kn-bremen.de) Received: from smtp.kn-bremen.de (gelbbaer.kn-bremen.de [78.46.108.116]) by mx1.freebsd.org (Postfix) with ESMTP id 8FC9E8FC08; Sat, 25 Feb 2012 07:13:50 +0000 (UTC) Received: by smtp.kn-bremen.de (Postfix, from userid 10) id 04A5D1E0024B; Sat, 25 Feb 2012 07:57:15 +0100 (CET) Received: from triton8.kn-bremen.de (noident@localhost [127.0.0.1]) by triton8.kn-bremen.de (8.14.4/8.14.4) with ESMTP id q1P6tiht015360; Sat, 25 Feb 2012 07:55:44 +0100 (CET) (envelope-from nox@triton8.kn-bremen.de) Received: (from nox@localhost) by triton8.kn-bremen.de (8.14.4/8.14.3/Submit) id q1P6tiSU015359; Sat, 25 Feb 2012 07:55:44 +0100 (CET) (envelope-from nox) Date: Sat, 25 Feb 2012 07:55:44 +0100 (CET) From: Juergen Lock Message-Id: <201202250655.q1P6tiSU015359@triton8.kn-bremen.de> To: freebsd@damnhippie.dyndns.org X-Newsgroups: local.list.freebsd.stable In-Reply-To: <1330126840.7317.60.camel@revolution.hippie.lan> References: <201202221334.36484.erich@alogreentechnologies.com> <64FF3DF7-6EEA-480D-85AA-5784AF013EA8@lassitu.de> <201202241350.56933.erichfreebsdlist@ovitrap.com> <1330100633.7317.41.camel@revolution.hippie.lan> <4F4811B4.4000701@FreeBSD.org> Organization: Cc: freebsd-stable@freebsd.org, Andriy Gapon Subject: geom vs. removable disks/cards (was: Re: random problem with 8.3 from yesterday) X-BeenThere: freebsd-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Production branch of FreeBSD source code List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 25 Feb 2012 07:13:50 -0000 In article <1330126840.7317.60.camel@revolution.hippie.lan> you write: >On Sat, 2012-02-25 at 00:39 +0200, Andriy Gapon wrote: >> on 24/02/2012 18:23 Ian Lepore said the following: >> > I've always >> > suspected something in the geom layer isn't noticing that a CF or SD >> > card in the reader got removed/inserted/reformatted, and un-/re-plugging >> > the whole reader (making the cam layer destroy and recreate the devices) >> > makes geom aware of the change. >> >> This is a fact, actually. Nothing in GEOM layer (and below it) notices a silent >> card change, since most hardware doesn't have any notification for the change >> and FreeBSD disk stack doesn't do any polling for changes. >> > >If the hardware did have change notification, is there a mechanism that >would communicate that to geom? That's a precursor question to my real >question: is there a way to manually kick geom when necessary? If the >api exists but there's no userland app to make the needed calls, I'll >write some code -- just point me at a manpage or header file. scsi has a mechanism called unit attention to report things like media changes, not sure usb devices use that tho since the host can only poll them... Anyway, the usual workaround is to force a geom retaste by opening the device for writing without actually writing anything, e.g.: # : >/dev/da0 Btw this can't be Erich's problem I'd say since he said he's plugging in a thumbdrive not a card into a reader (and also writing /dev/zero to it) so geom _should_ already taste it. (Unless the write fails since the thumbdrive is too slow initializing or something like that...) HTH, Juergen