Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 16 Mar 2022 04:06:53 GMT
From:      Alexander Motin <mav@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org
Subject:   git: bd0f3d34fa20 - main - GEOM: Fix regression after 7f16b501e25.
Message-ID:  <202203160406.22G46r6b070785@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
The branch main has been updated by mav:

URL: https://cgit.FreeBSD.org/src/commit/?id=bd0f3d34fa20686bac9a418d3a37a3f59c25ab19

commit bd0f3d34fa20686bac9a418d3a37a3f59c25ab19
Author:     Alexander Motin <mav@FreeBSD.org>
AuthorDate: 2022-03-16 03:58:09 +0000
Commit:     Alexander Motin <mav@FreeBSD.org>
CommitDate: 2022-03-16 04:06:49 +0000

    GEOM: Fix regression after 7f16b501e25.
    
    find_geom() in some classes trim leading "/dev/" from geom names.
    Lack of that in geom_gettree_geom() broke some existing scripts.
    
    PR:             262554
    MFC after:      2 months
---
 lib/libgeom/geom_xml2tree.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/lib/libgeom/geom_xml2tree.c b/lib/libgeom/geom_xml2tree.c
index a6da0e6d163f..52d21790101e 100644
--- a/lib/libgeom/geom_xml2tree.c
+++ b/lib/libgeom/geom_xml2tree.c
@@ -37,6 +37,7 @@
 #include <string.h>
 #include <unistd.h>
 #include <errno.h>
+#include <paths.h>
 #include <fcntl.h>
 #include <ctype.h>
 #include <sys/stat.h>
@@ -481,6 +482,8 @@ geom_gettree_geom(struct gmesh *gmp, const char *c, const char *g, int parents)
 	char *p;
 	int error;
 
+	if (g != NULL && strncmp(g, _PATH_DEV, sizeof(_PATH_DEV) - 1) == 0)
+		g += sizeof(_PATH_DEV) - 1;
 	p = geom_getxml_geom(c, g, parents);
 	if (p == NULL)
 		return (errno);



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202203160406.22G46r6b070785>