From owner-freebsd-bugs@FreeBSD.ORG Sun Jun 27 21:01:13 2004 Return-Path: Delivered-To: freebsd-bugs@hub.freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 43BA116A4CE for ; Sun, 27 Jun 2004 21:01:13 +0000 (GMT) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id 3D57343D48 for ; Sun, 27 Jun 2004 21:01:13 +0000 (GMT) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.12.11/8.12.11) with ESMTP id i5RL0i0n095486 for ; Sun, 27 Jun 2004 21:00:44 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.12.11/8.12.11/Submit) id i5RL0i0Z095485; Sun, 27 Jun 2004 21:00:44 GMT (envelope-from gnats) Date: Sun, 27 Jun 2004 21:00:44 GMT Message-Id: <200406272100.i5RL0i0Z095485@freefall.freebsd.org> To: freebsd-bugs@FreeBSD.org From: Hendrik Scholz Subject: Re: misc/68074: devstat: disappearing devices not properly removed X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list Reply-To: Hendrik Scholz List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 27 Jun 2004 21:01:13 -0000 The following reply was made to PR misc/68074; it has been noted by GNATS. From: Hendrik Scholz To: Poul-Henning Kamp Cc: Hendrik Scholz , FreeBSD-gnats-submit@freebsd.org Subject: Re: misc/68074: devstat: disappearing devices not properly removed Date: Sun, 27 Jun 2004 22:49:52 +0200 Hi! Poul-Henning Kamp wrote: >>>Fix: >> >>devstat_remove_entry() gets called in sys/cam/scsi/scsi_ch.c, scsi_pass.c, >>scsi_pt.c and scsi_sa.c but not in scsi_da.c and scsi_cd.c. >>This patch adds the appropriate calls for disks and cdroms. > > > I don't think this is the corrrect solution. > > scsi_da and scsi_ch are GEOM drivers and disk_destroy() should recover > those devstat entries in due time. Ok, I've moved devstat_remove_entry() to sys/geom/geom_disk.c and did the same test I've used before. --- sys/geom/geom_disk.c.orig Sun Jun 27 20:42:18 2004 +++ sys/geom/geom_disk.c Sun Jun 27 20:42:23 2004 @@ -401,10 +401,10 @@ void disk_destroy(struct disk *dp) { - g_cancel_event(dp); dp->d_destroyed = 1; g_post_event(g_disk_destroy, dp, M_WAITOK, NULL); + devstat_remove_entry(dp->d_devstat); } static void uname/dmesg: [0.13] root@deimos:/usr/src > uname -a FreeBSD deimos.raisdorf.net 5.2-CURRENT FreeBSD 5.2-CURRENT #1: Sun Jun 27 20:35:02 EDT 2004 hscholz@deimos.raisdorf.net:/usr/src/sys/i386/compile/DEIMOS i386 attach: umass0: SanDisk ImageMate CF, rev 2.00/1.19, addr 2 da0 at umass-sim0 bus 0 target 0 lun 0 da0: Removable Direct Access SCSI-0 device da0: 1.000MB/s transfers da0: 1027MB (2104704 512 byte sectors: 255H 63S/T 131C) detach: umass0: at uhub0 port 1 (addr 2) disconnected (da0:umass-sim0:0:0:0): lost device (da0:umass-sim0:0:0:0): removing device entry umass0: detached