mirror of
https://git.FreeBSD.org/src.git
synced 2025-01-17 15:27:36 +00:00
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
This commit is contained in:
parent
6eaa08deba
commit
268111a210
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=136503
@ -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)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user