Date: Sun, 27 Jun 2004 21:00:44 GMT From: Hendrik Scholz <hscholz@raisdorf.net> To: freebsd-bugs@FreeBSD.org Subject: Re: misc/68074: devstat: disappearing devices not properly removed Message-ID: <200406272100.i5RL0i0Z095485@freefall.freebsd.org>
next in thread | raw e-mail | index | archive | help
The following reply was made to PR misc/68074; it has been noted by GNATS. From: Hendrik Scholz <hscholz@raisdorf.net> To: Poul-Henning Kamp <phk@phk.freebsd.dk> Cc: Hendrik Scholz <hendrik@scholz.net>, 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: <Generic STORAGE DEVICE 0119> 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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200406272100.i5RL0i0Z095485>