aboutsummaryrefslogtreecommitdiff
path: root/sbin/geom/class/part
diff options
context:
space:
mode:
authorAlexander Motin <mav@FreeBSD.org>2015-03-26 12:17:47 +0000
committerAlexander Motin <mav@FreeBSD.org>2015-03-26 12:17:47 +0000
commit5523c82c1a804f3ce9dfff97afe0b61b24527861 (patch)
treeaae3d593194c3b8ad7d235fe3aad64e609c07a39 /sbin/geom/class/part
parent2f36085dcfeac50df82ebc147a95735f5a2a2717 (diff)
downloadsrc-5523c82c1a804f3ce9dfff97afe0b61b24527861.tar.gz
src-5523c82c1a804f3ce9dfff97afe0b61b24527861.zip
Make GEOM_PART work in presence of previous withered self.
MFC after: 2 weeks Sponsored by: iXsystems, Inc.
Notes
Notes: svn path=/head/; revision=280687
Diffstat (limited to 'sbin/geom/class/part')
-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 841695437e58..133e8f8281e9 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 *
@@ -609,6 +614,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);