From owner-cvs-src@FreeBSD.ORG Fri Nov 18 09:52:44 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 423D416A431; Fri, 18 Nov 2005 09:52:43 +0000 (GMT) (envelope-from phk@critter.freebsd.dk) Received: from phk.freebsd.dk (phk.freebsd.dk [130.225.244.222]) by mx1.FreeBSD.org (Postfix) with ESMTP id 4966A4404D; Fri, 18 Nov 2005 09:19:48 +0000 (GMT) (envelope-from phk@critter.freebsd.dk) Received: from critter.freebsd.dk (unknown [192.168.48.2]) by phk.freebsd.dk (Postfix) with ESMTP id 552BFBC66; Fri, 18 Nov 2005 09:19:40 +0000 (UTC) To: Nate Lawson From: "Poul-Henning Kamp" In-Reply-To: Your message of "Thu, 17 Nov 2005 21:46:29 PST." <437D6AB5.7020306@root.org> Date: Fri, 18 Nov 2005 10:19:40 +0100 Message-ID: <6759.1132305580@critter.freebsd.dk> Sender: phk@critter.freebsd.dk Cc: John Polstra , 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: Fri, 18 Nov 2005 09:52:44 -0000 In message <437D6AB5.7020306@root.org>, Nate Lawson writes: >> +void >> +disk_gone(struct disk *dp) >> +{ >> + struct g_geom *gp; >> + struct g_provider *pp; >> + >> + gp = dp->d_geom; >> + if (gp != NULL) >> + LIST_FOREACH(pp, &gp->provider, provider) >> + g_orphan_provider(pp, ENXIO); >> +} >> + > >Does there need to be locking for this list traversal? Couldn't >disk_gone() race in parallel with a taste event if someone plugs/unplugs >quickly, especially for a slow device (i.e. floppy)? Disk gone is called by the driver which owns struct disk, so nobody else has any business messing with that particular list. Obviously the driver needs to not stomp on itself, but Giant does that for CAM. -- Poul-Henning Kamp | UNIX since Zilog Zeus 3.20 phk@FreeBSD.ORG | TCP/IP since RFC 956 FreeBSD committer | BSD since 4.3-tahoe Never attribute to malice what can adequately be explained by incompetence.