From nobody Sun Oct 23 01:48:18 2022 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 4Mw1Lq0TJtz4gnZG; Sun, 23 Oct 2022 01:48:19 +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 4Mw1Lp71nvz3XTQ; Sun, 23 Oct 2022 01:48:18 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1666489699; 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=3B6IQ4ZLuYGgZoMJMy7EFcaAOPEa9OQ1J/jNWN4LF/k=; b=qVLP0LRh6RdLWDXLN8R2AhclLACbTejbPN2jBG9okESoHcVG8dt8r5Kq6fJsmrm3BfY5+v ds6cWeM2dO4w6rGo2nzu8rSjPKNmLXWiQf4w0sqB0sD5R9ove3qaY+/35WOrDaJ15ywocZ IevZyAuOcQJ5zE+8oi5nG823bHh6D54q+GaqQXxj4s/yk4HTnDQs48RTz3qpdYlqFY+pfJ MtD+oD5LcMeqo/tyReWaariiqzhSYBiilfi79dgce9pY5//XdDtVfO9l+mgbikpbdD8iZf dbdyhvlevvSfxNpRRDc229UiFYy40MeGCcYI5cAPAba1x05bvFD9fiHf1m55Ng== 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 4Mw1Lp63fqzl1K; Sun, 23 Oct 2022 01:48:18 +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 29N1mIm7069538; Sun, 23 Oct 2022 01:48:18 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 29N1mIhh069537; Sun, 23 Oct 2022 01:48:18 GMT (envelope-from git) Date: Sun, 23 Oct 2022 01:48:18 GMT Message-Id: <202210230148.29N1mIhh069537@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: bb3230e40bea - main - geli: Move check for DEVT_DISK into geli_probe_and_attach 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: bb3230e40bea68c1a0fc9ba1bee204bc05d7ea78 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1666489699; 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=3B6IQ4ZLuYGgZoMJMy7EFcaAOPEa9OQ1J/jNWN4LF/k=; b=GJeqLRn6gIancur8gMO8EWe+kAskPsGWlWg0MEGbIzfxoxKKnzj2X/VupjOvQpQYH9lVkT OuquKkm7UJCoVXmwaQzK38WgGAE7YSXw1q2hXqXgcK3ra3SV11BISBu2DIoAl9Mc2CGVNz 4QDJdKIcUi0yrt5Z9P/yAbDh1GPKFOepLAicLk9ychGr66a5lnQK6hQUhL4Cm5wnCCSUUe Iv/hljfHk5gudjNkgu+Q5mYyuUCEQ56HdWVTuoRsUZbIYde2hzzlje7oYBU+nygny6Izg4 4/6cTj2PIpPp/6RaILmtPyuD0mgzVN9ad4Rp2UadslMYUUVywtdjfJiwG18ZUA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1666489699; a=rsa-sha256; cv=none; b=tAm4PWiv/7Pio4l6A7IwCP1zBxjTlacjjQ3saYgLoR+6LYRcS80kqzbcsKG7CBEf+nxX9e Yr4NgVdbaBlUGTNEVakZ8rfdpAyIHep4+pKqWOpq7Gtx9q6EPg5ePOVAhSSL0jkguPaPl3 GcytU6MvOMhU8bnxuvRZ16wLq3HiB3tqXvCPuWRNdneT8p/7AsUtgCeKVp3FJg4wyhvVfQ Nn/gCoE9B18iKnudI50X3DBlk3uigEoDiA8HmzwSwByq1kxKs3z4hTvdfkXEMMWaWPMns+ +6mTCovsIb8X11L8d07WPqgotCkrRPhBxwjSVEVRhC4zgn0S+tScFstpMakCOw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=bb3230e40bea68c1a0fc9ba1bee204bc05d7ea78 commit bb3230e40bea68c1a0fc9ba1bee204bc05d7ea78 Author: Warner Losh AuthorDate: 2022-10-22 00:16:56 +0000 Commit: Warner Losh CommitDate: 2022-10-23 01:47:24 +0000 geli: Move check for DEVT_DISK into geli_probe_and_attach We only work on DEVT_DISK disks, so move that into the probe to drive the point home better. Sponsored by: Netflix --- stand/common/devopen.c | 4 +--- stand/libsa/geli/gelidev.c | 3 +++ 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/stand/common/devopen.c b/stand/common/devopen.c index 8fd2c1796555..4fd955d5a9eb 100644 --- a/stand/common/devopen.c +++ b/stand/common/devopen.c @@ -63,9 +63,7 @@ devopen(struct open_file *f, const char *fname, const char **file) * pw if needed), this will attach the geli code to the open_file by * replacing f->f_dev and f_devdata with pointers to a geli_devdesc. */ - if (f->f_dev->dv_type == DEVT_DISK) { - geli_probe_and_attach(f); - } + geli_probe_and_attach(f); #endif return (0); diff --git a/stand/libsa/geli/gelidev.c b/stand/libsa/geli/gelidev.c index 2dd686c81883..23ded496c23d 100644 --- a/stand/libsa/geli/gelidev.c +++ b/stand/libsa/geli/gelidev.c @@ -301,6 +301,9 @@ geli_probe_and_attach(struct open_file *f) hdesc = (struct disk_devdesc *)(f->f_devdata); + /* We only work on DEVT_DISKs */ + if (hdesc->dd.d_dev->dv_type != DEVT_DISK) + return; /* Get the last block number for the host provider. */ if (hdesc->dd.d_dev->dv_ioctl(f, DIOCGMEDIASIZE, &hmediasize) != 0) return;