From owner-cvs-src@FreeBSD.ORG Sat Nov 19 18:29:21 2005 Return-Path: X-Original-To: cvs-src@FreeBSD.org Delivered-To: cvs-src@FreeBSD.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 6837C16A41F; Sat, 19 Nov 2005 18:29:21 +0000 (GMT) (envelope-from tataz@tataz.chchile.org) Received: from smtp3-g19.free.fr (smtp3-g19.free.fr [212.27.42.29]) by mx1.FreeBSD.org (Postfix) with ESMTP id ED7F943D53; Sat, 19 Nov 2005 18:29:20 +0000 (GMT) (envelope-from tataz@tataz.chchile.org) Received: from tatooine.tataz.chchile.org (vol75-8-82-233-239-98.fbx.proxad.net [82.233.239.98]) by smtp3-g19.free.fr (Postfix) with ESMTP id 1D3EB3742F; Sat, 19 Nov 2005 19:29:19 +0100 (CET) Received: by tatooine.tataz.chchile.org (Postfix, from userid 1000) id C8B75405A; Sat, 19 Nov 2005 19:28:53 +0100 (CET) Date: Sat, 19 Nov 2005 19:28:53 +0100 From: Jeremie Le Hen To: John Polstra Message-ID: <20051119182853.GX5197@obiwan.tataz.chchile.org> References: <200511180243.jAI2hnhJ050562@repoman.freebsd.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <200511180243.jAI2hnhJ050562@repoman.freebsd.org> User-Agent: Mutt/1.5.11 Cc: cvs-src@FreeBSD.org, src-committers@FreeBSD.org, cvs-all@FreeBSD.org Subject: Re: cvs commit: src/sys/cam/scsi scsi_cd.c scsi_da.c src/sys/geom geom_disk.c geom_disk.h geom_subr.c X-BeenThere: cvs-src@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: CVS commit messages for the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 19 Nov 2005 18:29:21 -0000 Hi, John, On Fri, Nov 18, 2005 at 02:43:49AM +0000, John Polstra wrote: > jdp 2005-11-18 02:43:49 UTC > > FreeBSD src repository > > Modified files: > sys/cam/scsi scsi_cd.c scsi_da.c > sys/geom geom_disk.c geom_disk.h geom_subr.c > Log: > Fix a bug that caused some /dev entries to continue to exist after > the underlying drive had been hot-unplugged from the system. Here > is a specific example. Filesystem code had opened /dev/da1s1e. > Subsequently, the drive was hot-unplugged. This (correctly) caused > all of the associated /dev/da1* entries to be deleted. When the > filesystem later realized that the drive was gone it closed the > device, reducing the write-access counts to 0 on the geom providers > for da1s1e, da1s1, and da1. This caused geom to re-taste the > providers, resulting in the devices being created again. When the > drive was hot-plugged back in, it resulted in duplicate /dev entries > for da1s1e, da1s1, and da1. > > This fix adds a new disk_gone() function which is called by CAM when a > drive goes away. It orphans all of the providers associated with the > drive, setting an error condition of ENXIO in each one. In addition, > we prevent a re-taste on last close for writing if an error condition > has been set in the provider. This commit stirred my memory up about panicking when hot-unplugging an USB key while it is still mounted. I have not been able to track HEAD source changes attentively for some time recently but it appears from the above description that this awkard behaviour has been replaced by a smarter one (IOW, return ENXIO on all pending filesystem actions). Thanks in advance for explanations. Best regards, -- Jeremie Le Hen < jeremie at le-hen dot org >< ttz at chchile dot org >