summaryrefslogtreecommitdiffstats
path: root/sys/geom/concat/g_concat.c
diff options
context:
space:
mode:
Diffstat (limited to 'sys/geom/concat/g_concat.c')
-rw-r--r--sys/geom/concat/g_concat.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/sys/geom/concat/g_concat.c b/sys/geom/concat/g_concat.c
index 480b30d..8103ea6 100644
--- a/sys/geom/concat/g_concat.c
+++ b/sys/geom/concat/g_concat.c
@@ -567,6 +567,15 @@ g_concat_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 < 3)
+ 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.
@@ -650,6 +659,7 @@ g_concat_ctl_create(struct gctl_req *req, struct g_class *mp)
md.md_id = arc4random();
md.md_no = 0;
md.md_all = *nargs - 1;
+ bzero(md.md_provider, sizeof(md.md_provider));
/* Check all providers are valid */
for (no = 1; no < *nargs; no++) {
OpenPOWER on IntegriCloud