summaryrefslogtreecommitdiffstats
path: root/sbin
diff options
context:
space:
mode:
authormav <mav@FreeBSD.org>2015-04-09 10:10:05 +0000
committermav <mav@FreeBSD.org>2015-04-09 10:10:05 +0000
commit5f22f76484ca0d7ab92d0d4190aafcb0d796a0f3 (patch)
tree0d36e36d8e52fbecb3ae89e61c842c29ceb5de3a /sbin
parent2b74acfbccc9df3abd609f0c8106be951ea02875 (diff)
downloadFreeBSD-src-5f22f76484ca0d7ab92d0d4190aafcb0d796a0f3.zip
FreeBSD-src-5f22f76484ca0d7ab92d0d4190aafcb0d796a0f3.tar.gz
MFC r280687: Make GEOM_PART work in presence of previous withered self.
Diffstat (limited to 'sbin')
-rw-r--r--sbin/geom/class/part/geom_part.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/sbin/geom/class/part/geom_part.c b/sbin/geom/class/part/geom_part.c
index 32203f7..83e0b11 100644
--- a/sbin/geom/class/part/geom_part.c
+++ b/sbin/geom/class/part/geom_part.c
@@ -207,15 +207,20 @@ find_class(struct gmesh *mesh, const char *name)
static struct ggeom *
find_geom(struct gclass *classp, const char *name)
{
- struct ggeom *gp;
+ struct ggeom *gp, *wgp;
if (strncmp(name, _PATH_DEV, sizeof(_PATH_DEV) - 1) == 0)
name += sizeof(_PATH_DEV) - 1;
+ wgp = NULL;
LIST_FOREACH(gp, &classp->lg_geom, lg_geom) {
- if (strcmp(gp->lg_name, name) == 0)
+ if (strcmp(gp->lg_name, name) != 0)
+ continue;
+ if (find_geomcfg(gp, "wither") == NULL)
return (gp);
+ else
+ wgp = gp;
}
- return (NULL);
+ return (wgp);
}
static const char *
@@ -598,6 +603,8 @@ gpart_show_geom(struct ggeom *gp, const char *element, int show_providers)
off_t length, secsz;
int idx, wblocks, wname, wmax;
+ if (find_geomcfg(gp, "wither"))
+ return;
scheme = find_geomcfg(gp, "scheme");
if (scheme == NULL)
errx(EXIT_FAILURE, "Scheme not found for geom %s", gp->lg_name);
OpenPOWER on IntegriCloud