From owner-cvs-src@FreeBSD.ORG Fri Nov 18 02:43:52 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 E5B1C16A41F; Fri, 18 Nov 2005 02:43:52 +0000 (GMT) (envelope-from jdp@FreeBSD.org) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id EE2AF43D6D; Fri, 18 Nov 2005 02:43:49 +0000 (GMT) (envelope-from jdp@FreeBSD.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.1/8.13.1) with ESMTP id jAI2hnas050563; Fri, 18 Nov 2005 02:43:49 GMT (envelope-from jdp@repoman.freebsd.org) Received: (from jdp@localhost) by repoman.freebsd.org (8.13.1/8.13.1/Submit) id jAI2hnhJ050562; Fri, 18 Nov 2005 02:43:49 GMT (envelope-from jdp) Message-Id: <200511180243.jAI2hnhJ050562@repoman.freebsd.org> From: John Polstra Date: Fri, 18 Nov 2005 02:43:49 +0000 (UTC) To: src-committers@FreeBSD.org, cvs-src@FreeBSD.org, cvs-all@FreeBSD.org X-FreeBSD-CVS-Branch: HEAD Cc: Subject: 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: Fri, 18 Nov 2005 02:43:53 -0000 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. Sponsored by: Isilon Systems Reviewed by: phk MFC after: 1 week Revision Changes Path 1.94 +1 -0 src/sys/cam/scsi/scsi_cd.c 1.181 +1 -0 src/sys/cam/scsi/scsi_da.c 1.98 +12 -0 src/sys/geom/geom_disk.c 1.5 +1 -0 src/sys/geom/geom_disk.h 1.88 +3 -2 src/sys/geom/geom_subr.c