From nobody Thu Feb 16 15:58:46 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PHfkb2PGnz3r6tP; Thu, 16 Feb 2023 15:58:47 +0000 (UTC) (envelope-from git@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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4PHfkb1kKnz3xS2; Thu, 16 Feb 2023 15:58:47 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676563127; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Oq8NCuPjnb4AtTF56MxM8CQWYgGbO5K319/xPNnTTY0=; b=hk1SZLiF6EnqlO/+QQE0Fj2AxqxPqyf7pP/LYO6eRXSd1dYAFydGyXxe2d+6CjPDcLMZJi Z35rmUtWxbcnSanj+gH/rUob26qKsTDiiZs+wlQJeJDWuWRVY9hsCET5cGZTBQndjL54Bp DrRTTG4dc6RYxcMPWSkKw8eQs71pvtG37NIb/AakRHPGAWzd5czj/k2H6A8laLklv6AZPa SaXAvgrkg1HXJ3pau7PaOUVxBol+ie36cO1DGdmsyrkwVO45wKy/4JSlld2YSLUN3WrNYj PGUV5ktZZq8cOu8V5bVDR8v9HqK2qMGXSmaollpsWxEdCHP4s5lMSoGFCZ1CNg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676563127; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Oq8NCuPjnb4AtTF56MxM8CQWYgGbO5K319/xPNnTTY0=; b=wiUPwcAU5GfvHddVIbRXv9l8+kLvY9vbUfmcWz2pattOReOXjtuQUg7K/agvzjXQm8beC5 diMKBheKwX8xHRtZpG8ODwC2I6WwEDA/dlRg4Jh6WyKglU2t/YU4ezMHQz+xTZ3WLPIvtw fyv4+zgeEf3rzaiDN2MgFj6RDUS0WwMauB73rYpPc8MIJSURgLnQPQ3YloIedjQf96+zRh WUiy6G/oaLL86HYvS6QpgTH+SmjDmDWkbe+Rp52bqQd952fMrGGy63tycFYaChuDDtT1bT U8C0L2gDdxus+HLOz8RoSnkhKOCcl07vPtz35rXDIQzG0pLJSe9xBNmzCv/tVg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1676563127; a=rsa-sha256; cv=none; b=fneaKh2xERkq+2CL5FHXEkUpq/PKI7+iE3PrfvKdBDmSaRjCUVR7VtlkYDIKV6n5MU5Cfs tXu00FS6rGZ6KQUXX0IEoJkGV8k4YnR0YXaYO6d6JuPFm/ETN6X/W+1WsMCAqUhZlBVEz3 pba2Yot08473XHCxNkdO8hsW+Vy+1YycQvFqSJR1gzRly46rg8druCpRk6TXi3Lo5XGDN8 tDgyHbidiRAAcIc/HgceBokrdngDMTGMKzQGDq2/UIhEwBNo58iBUT2kh7TjtMsPwHAXLd nB6db1ulqd/HJuNM2ZIfNomvcjFE/qpCZTZkVOrZQ7VAle2HHC4Ws9DI2dSN5A== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PHfkb0hNtz18dn; Thu, 16 Feb 2023 15:58:47 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 31GFwkrT099956; Thu, 16 Feb 2023 15:58:46 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 31GFwkTS099955; Thu, 16 Feb 2023 15:58:46 GMT (envelope-from git) Date: Thu, 16 Feb 2023 15:58:46 GMT Message-Id: <202302161558.31GFwkTS099955@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Warner Losh Subject: git: ccf2121d59ac - main - efivar: Try harder to find label's efimedia List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: ccf2121d59ac51e1a0287d75262d48018d09cad6 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=ccf2121d59ac51e1a0287d75262d48018d09cad6 commit ccf2121d59ac51e1a0287d75262d48018d09cad6 Author: Warner Losh AuthorDate: 2023-02-16 15:53:15 +0000 Commit: Warner Losh CommitDate: 2023-02-16 15:54:39 +0000 efivar: Try harder to find label's efimedia If there's no efimedia attribute on the provider, and the provider's a glabel, then find the 'parent' geom. In this case, the provider's name is label-type/name, but the geom's label will that of the underlying device (eg ada0p1). If it is, recurisvely call find_geom_efimedia with the geom's name, which shuold have the efimedia attribute. Sponsored by: Netflix Reviewed by: corvink, manu, asomers Differential Revision: https://reviews.freebsd.org/D38614 --- lib/libefivar/efivar-dp-xlate.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/lib/libefivar/efivar-dp-xlate.c b/lib/libefivar/efivar-dp-xlate.c index 1b30d1dfb143..effc8a2de475 100644 --- a/lib/libefivar/efivar-dp-xlate.c +++ b/lib/libefivar/efivar-dp-xlate.c @@ -527,6 +527,15 @@ find_geom_efimedia(struct gmesh *mesh, const char *dev) if (pp == NULL) return (NULL); efimedia = geom_pp_attr(mesh, pp, "efimedia"); + + /* + * If this device doesn't hav an efimedia attribute, see if it is a + * glabel node, and if so look for the underlying provider to get the + * efimedia attribute from. + */ + if (efimedia == NULL && + strcmp(pp->lg_geom->lg_class->lg_name, G_LABEL) == 0) + efimedia = find_geom_efimedia(mesh, pp->lg_geom->lg_name); if (efimedia == NULL) return (NULL); return strdup(efimedia);