aboutsummaryrefslogtreecommitdiff
path: root/sys/geom/geom_disk.c
diff options
context:
space:
mode:
authorPoul-Henning Kamp <phk@FreeBSD.org>2004-06-27 20:53:20 +0000
committerPoul-Henning Kamp <phk@FreeBSD.org>2004-06-27 20:53:20 +0000
commit52c583feb9feaddf446f9fde3ec0deffe87dba53 (patch)
treeff062a8cdcfc402fe33e7ccbab930bfc5b16364f /sys/geom/geom_disk.c
parente9f58c27b968ef0fe851a30095777cbc54b10065 (diff)
downloadsrc-52c583feb9feaddf446f9fde3ec0deffe87dba53.tar.gz
src-52c583feb9feaddf446f9fde3ec0deffe87dba53.zip
Make sure to kill the devstat entry for disappearing disks.
PR: 68074 Submitted by: Hendrik Scholz <hscholz@raisdorf.net>
Notes
Notes: svn path=/head/; revision=131207
Diffstat (limited to 'sys/geom/geom_disk.c')
-rw-r--r--sys/geom/geom_disk.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/sys/geom/geom_disk.c b/sys/geom/geom_disk.c
index 87ae2ad22387..7145c0d2e60f 100644
--- a/sys/geom/geom_disk.c
+++ b/sys/geom/geom_disk.c
@@ -404,7 +404,9 @@ disk_destroy(struct disk *dp)
g_cancel_event(dp);
dp->d_destroyed = 1;
- g_post_event(g_disk_destroy, dp, M_WAITOK, NULL);
+ if (dp->d_devstat != NULL)
+ devstat_remove_entry(dp->d_devstat);
+ g_post_event(g_disk_destroy, dp, M_WAITOK, NULL, NULL);
}
static void