From owner-svn-src-all@freebsd.org Sat Dec 12 07:22:39 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 0BAFB4ABA3C; Sat, 12 Dec 2020 07:22:39 +0000 (UTC) (envelope-from rew@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CtJyQ6c6Gz4Z7Z; Sat, 12 Dec 2020 07:22:38 +0000 (UTC) (envelope-from rew@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D5A51190F3; Sat, 12 Dec 2020 07:22:38 +0000 (UTC) (envelope-from rew@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 0BC7McRh053859; Sat, 12 Dec 2020 07:22:38 GMT (envelope-from rew@FreeBSD.org) Received: (from rew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0BC7McvD053858; Sat, 12 Dec 2020 07:22:38 GMT (envelope-from rew@FreeBSD.org) Message-Id: <202012120722.0BC7McvD053858@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rew set sender to rew@FreeBSD.org using -f From: Robert Wing Date: Sat, 12 Dec 2020 07:22:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r368576 - head/sbin/geom/core X-SVN-Group: head X-SVN-Commit-Author: rew X-SVN-Commit-Paths: head/sbin/geom/core X-SVN-Commit-Revision: 368576 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 12 Dec 2020 07:22:39 -0000 Author: rew Date: Sat Dec 12 07:22:38 2020 New Revision: 368576 URL: https://svnweb.freebsd.org/changeset/base/368576 Log: geom(8): list geoms with /dev/ prefix Allow geom(8) to list geoms with the '/dev/' prefix. `geom part show` accepts the '/dev/' prefix but `geom part list` does not. Modify find_geom() in sbin/geom/core/geom.c to be consistent with the behavior of find_geom() in lib/geom/part/geom_part.c. PR: 188213 Reported by: Ronald F. Guilmette Reviewed by: imp, kevans Approved by: kevans (mentor) MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D27556 Modified: head/sbin/geom/core/geom.c Modified: head/sbin/geom/core/geom.c ============================================================================== --- head/sbin/geom/core/geom.c Sat Dec 12 05:57:42 2020 (r368575) +++ head/sbin/geom/core/geom.c Sat Dec 12 07:22:38 2020 (r368576) @@ -37,6 +37,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -861,6 +862,9 @@ static struct ggeom * find_geom(struct gclass *classp, const char *name) { struct ggeom *gp; + + if (strncmp(name, _PATH_DEV, sizeof(_PATH_DEV) - 1) == 0) + name += sizeof(_PATH_DEV) - 1; LIST_FOREACH(gp, &classp->lg_geom, lg_geom) { if (strcmp(gp->lg_name, name) == 0)