summaryrefslogtreecommitdiffstats
path: root/sys/geom/stripe/g_stripe.c
diff options
context:
space:
mode:
Diffstat (limited to 'sys/geom/stripe/g_stripe.c')
-rw-r--r--sys/geom/stripe/g_stripe.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/sys/geom/stripe/g_stripe.c b/sys/geom/stripe/g_stripe.c
index 017cf3c..a661704 100644
--- a/sys/geom/stripe/g_stripe.c
+++ b/sys/geom/stripe/g_stripe.c
@@ -898,6 +898,15 @@ g_stripe_taste(struct g_class *mp, struct g_provider *pp, int flags __unused)
pp->name);
return (NULL);
}
+ /*
+ * Backward compatibility:
+ * There was no md_provider field in earlier versions of metadata.
+ */
+ if (md.md_version < 2)
+ bzero(md.md_provider, sizeof(md.md_provider));
+
+ if (md.md_provider[0] != '\0' && strcmp(md.md_provider, pp->name) != 0)
+ return (NULL);
/*
* Let's check if device already exists.
@@ -988,6 +997,7 @@ g_stripe_ctl_create(struct gctl_req *req, struct g_class *mp)
return;
}
md.md_stripesize = *stripesize;
+ bzero(md.md_provider, sizeof(md.md_provider));
/* Check all providers are valid */
for (no = 1; no < *nargs; no++) {
OpenPOWER on IntegriCloud