summaryrefslogtreecommitdiffstats
path: root/sys/geom/concat/g_concat.c
diff options
context:
space:
mode:
authorpjd <pjd@FreeBSD.org>2005-02-27 23:07:47 +0000
committerpjd <pjd@FreeBSD.org>2005-02-27 23:07:47 +0000
commit668a0286708d7bde5d5f9e9076fa8ffe8ec62f34 (patch)
treef9b8b8d23d31087c21fbc78a229ae7d39ac1bfb1 /sys/geom/concat/g_concat.c
parenta8b71d95fab6042a43dfe6aa45b43537a7eb00ba (diff)
downloadFreeBSD-src-668a0286708d7bde5d5f9e9076fa8ffe8ec62f34.zip
FreeBSD-src-668a0286708d7bde5d5f9e9076fa8ffe8ec62f34.tar.gz
- Add md_provsize field to metadata, which will help with
shared-last-sector problem. After this change, even if there is more than one provider with the same last sector, the proper one will be chosen based on its size. It still doesn't fix the 'c' partition problem (when da0s1 can be confused with da0s1c) and situation when 'a' partition starts at offset 0 (then da0s1a can be confused with da0s1 and da0s1c). One can use '-h' option there, when creating device or avoid sharing last sector. Actually, when providers share the same last sector and their size is equal, they provide exactly the same data, so the name (da0s1, da0s1a, da0s1c) isn't important at all. - Provide backward compatibility. - Update copyright's year. MFC after: 1 week
Diffstat (limited to 'sys/geom/concat/g_concat.c')
-rw-r--r--sys/geom/concat/g_concat.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/sys/geom/concat/g_concat.c b/sys/geom/concat/g_concat.c
index a1e1765..49087ca 100644
--- a/sys/geom/concat/g_concat.c
+++ b/sys/geom/concat/g_concat.c
@@ -1,5 +1,5 @@
/*-
- * Copyright (c) 2004 Pawel Jakub Dawidek <pjd@FreeBSD.org>
+ * Copyright (c) 2004-2005 Pawel Jakub Dawidek <pjd@FreeBSD.org>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -570,13 +570,18 @@ g_concat_taste(struct g_class *mp, struct g_provider *pp, int flags __unused)
}
/*
* Backward compatibility:
- * There was no md_provider field in earlier versions of metadata.
*/
+ /* There was no md_provider field in earlier versions of metadata. */
if (md.md_version < 3)
bzero(md.md_provider, sizeof(md.md_provider));
+ /* There was no md_provsize field in earlier versions of metadata. */
+ if (md.md_version < 4)
+ md.md_provsize = pp->mediasize;
if (md.md_provider[0] != '\0' && strcmp(md.md_provider, pp->name) != 0)
return (NULL);
+ if (md.md_provsize != pp->mediasize)
+ return (NULL);
/*
* Let's check if device already exists.
@@ -661,6 +666,8 @@ g_concat_ctl_create(struct gctl_req *req, struct g_class *mp)
md.md_no = 0;
md.md_all = *nargs - 1;
bzero(md.md_provider, sizeof(md.md_provider));
+ /* This field is not important here. */
+ md.md_provsize = 0;
/* Check all providers are valid */
for (no = 1; no < *nargs; no++) {
OpenPOWER on IntegriCloud