summaryrefslogtreecommitdiffstats
path: root/sys
diff options
context:
space:
mode:
Diffstat (limited to 'sys')
-rw-r--r--sys/geom/concat/g_concat.c5
-rw-r--r--sys/geom/label/g_label.c20
-rw-r--r--sys/geom/stripe/g_stripe.c5
3 files changed, 14 insertions, 16 deletions
diff --git a/sys/geom/concat/g_concat.c b/sys/geom/concat/g_concat.c
index 943ac2b..480b30d 100644
--- a/sys/geom/concat/g_concat.c
+++ b/sys/geom/concat/g_concat.c
@@ -552,9 +552,10 @@ g_concat_taste(struct g_class *mp, struct g_provider *pp, int flags __unused)
gp->orphan = g_concat_orphan;
cp = g_new_consumer(gp);
g_attach(cp, pp);
-
error = g_concat_read_metadata(cp, &md);
- g_wither_geom(gp, ENXIO);
+ g_detach(cp);
+ g_destroy_consumer(cp);
+ g_destroy_geom(gp);
if (error != 0)
return (NULL);
gp = NULL;
diff --git a/sys/geom/label/g_label.c b/sys/geom/label/g_label.c
index fdc05c1..c6f7217 100644
--- a/sys/geom/label/g_label.c
+++ b/sys/geom/label/g_label.c
@@ -194,7 +194,7 @@ g_label_taste(struct g_class *mp, struct g_provider *pp, int flags __unused)
struct g_label_metadata md;
struct g_consumer *cp;
struct g_geom *gp;
- int error, i;
+ int i;
g_trace(G_T_TOPOLOGY, "%s(%s, %s)", __func__, mp->name, pp->name);
g_topology_assert();
@@ -210,15 +210,10 @@ g_label_taste(struct g_class *mp, struct g_provider *pp, int flags __unused)
gp->orphan = g_label_orphan;
cp = g_new_consumer(gp);
g_attach(cp, pp);
- error = g_access(cp, 1, 0, 0);
- if (error != 0) {
- g_wither_geom(gp, ENXIO);
- return (NULL);
- }
-
+ if (g_access(cp, 1, 0, 0) != 0)
+ goto end;
do {
- error = g_label_read_metadata(cp, &md);
- if (error != 0)
+ if (g_label_read_metadata(cp, &md) != 0)
break;
if (strcmp(md.md_magic, G_LABEL_MAGIC) != 0)
break;
@@ -241,10 +236,11 @@ g_label_taste(struct g_class *mp, struct g_provider *pp, int flags __unused)
g_label_create(NULL, mp, pp, label, g_labels[i]->ld_dir,
pp->mediasize);
}
-
g_access(cp, -1, 0, 0);
- g_wither_geom(gp, ENXIO);
-
+end:
+ g_detach(cp);
+ g_destroy_consumer(cp);
+ g_destroy_geom(gp);
return (NULL);
}
diff --git a/sys/geom/stripe/g_stripe.c b/sys/geom/stripe/g_stripe.c
index e3106b4..017cf3c 100644
--- a/sys/geom/stripe/g_stripe.c
+++ b/sys/geom/stripe/g_stripe.c
@@ -883,9 +883,10 @@ g_stripe_taste(struct g_class *mp, struct g_provider *pp, int flags __unused)
gp->orphan = g_stripe_orphan;
cp = g_new_consumer(gp);
g_attach(cp, pp);
-
error = g_stripe_read_metadata(cp, &md);
- g_wither_geom(gp, ENXIO);
+ g_detach(cp);
+ g_destroy_consumer(cp);
+ g_destroy_geom(gp);
if (error != 0)
return (NULL);
gp = NULL;
OpenPOWER on IntegriCloud