diff options
author | pjd <pjd@FreeBSD.org> | 2004-10-14 07:46:13 +0000 |
---|---|---|
committer | pjd <pjd@FreeBSD.org> | 2004-10-14 07:46:13 +0000 |
commit | c06dbb041524f92cefecce8b2e7112fa5ecef66d (patch) | |
tree | b6c7fd815a9ff86c7dbff963e10933b32d1dd4ca /sys | |
parent | 44fa180124759a86fcd899438ddb836c77636604 (diff) | |
download | FreeBSD-src-c06dbb041524f92cefecce8b2e7112fa5ecef66d.zip FreeBSD-src-c06dbb041524f92cefecce8b2e7112fa5ecef66d.tar.gz |
Only allow for unloading when there are no geoms in LABEL GEOM class.
We have to use our own destroy_geom method, because default one, which
is a part of geom_slice is broken.
MT5 candidate.
PR: kern/72467
Submitted by: Vladimir Novoseltsev
Diffstat (limited to 'sys')
-rw-r--r-- | sys/geom/label/g_label.c | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/sys/geom/label/g_label.c b/sys/geom/label/g_label.c index e224c43..a2f6dbd 100644 --- a/sys/geom/label/g_label.c +++ b/sys/geom/label/g_label.c @@ -48,6 +48,8 @@ TUNABLE_INT("kern.geom.label.debug", &g_label_debug); SYSCTL_UINT(_kern_geom_label, OID_AUTO, debug, CTLFLAG_RW, &g_label_debug, 0, "Debug level"); +static int g_label_destroy_geom(struct gctl_req *req, struct g_class *mp, + struct g_geom *gp); static int g_label_destroy(struct g_geom *gp, boolean_t force); static struct g_geom *g_label_taste(struct g_class *mp, struct g_provider *pp, int flags __unused); @@ -58,7 +60,8 @@ struct g_class g_label_class = { .name = G_LABEL_CLASS_NAME, .version = G_VERSION, .ctlreq = g_label_config, - .taste = g_label_taste + .taste = g_label_taste, + .destroy_geom = g_label_destroy_geom }; /* @@ -76,6 +79,18 @@ const struct g_label_desc *g_labels[] = { }; +static int +g_label_destroy_geom(struct gctl_req *req __unused, struct g_class *mp, + struct g_geom *gp __unused) +{ + + /* + * XXX: Unloading a class which is using geom_slice:1.56 is currently + * XXX: broken, so we deny unloading when we have geoms. + */ + return (EOPNOTSUPP); +} + static void g_label_orphan(struct g_consumer *cp __unused) { |