From owner-freebsd-geom@FreeBSD.ORG Mon Apr 19 13:54:32 2010 Return-Path: Delivered-To: freebsd-geom@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4E3B11065674; Mon, 19 Apr 2010 13:54:32 +0000 (UTC) (envelope-from avg@icyb.net.ua) Received: from citadel.icyb.net.ua (citadel.icyb.net.ua [212.40.38.140]) by mx1.freebsd.org (Postfix) with ESMTP id 2B0758FC16; Mon, 19 Apr 2010 13:54:30 +0000 (UTC) Received: from odyssey.starpoint.kiev.ua (alpha-e.starpoint.kiev.ua [212.40.38.101]) by citadel.icyb.net.ua (8.8.8p3/ICyb-2.3exp) with ESMTP id QAA28243; Mon, 19 Apr 2010 16:54:28 +0300 (EEST) (envelope-from avg@icyb.net.ua) Message-ID: <4BCC6093.5060007@icyb.net.ua> Date: Mon, 19 Apr 2010 16:54:27 +0300 From: Andriy Gapon User-Agent: Thunderbird 2.0.0.24 (X11/20100319) MIME-Version: 1.0 To: bug-followup@FreeBSD.org, gcooper@FreeBSD.org, freebsd-geom@FreeBSD.org X-Enigmail-Version: 0.95.7 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Cc: Subject: Re: kern/145818: [geom] geom_stat_open showing cached information for non-present iso X-BeenThere: freebsd-geom@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: GEOM-specific discussions and implementations List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Apr 2010 13:54:32 -0000 In my opinion this is an issue of CAM peripheral disk drivers (and most probably all other disk drivers) not communicating media change events even when those events are readily known to the drivers. One simple is example is CDIOCEJECT/CDIOCCLOSE ioctls of cd(4). Other possibilities for detecting media change: handle SCSI ASC 28h ("NOT READY TO READY CHANGE, MEDIUM MAY HAVE CHANGED"); poll for media removal/change; poll for CD drive eject button precesses (things that hald does in userland). AFAICS, currently there is no abstraction to pass media change events from disk layer to GEOM. E.g. something like disk_media_changed() that would call g_spoil or post g_new_provider_event to trigger re-taste as appropriate. Sounds easy, but the devil is in the details, there might be some locking/layering concerns. But, OTOH, we do this kind of things in g_access, I don't see why we couldn't do them in disk drivers. -- Andriy Gapon