git: 053b95d94896 - stable/12 - Remove whole-disk vdev support from zfsboot

From: Kyle Evans <kevans_at_FreeBSD.org>
Date: Fri, 08 Oct 2021 06:10:25 UTC
The branch stable/12 has been updated by kevans:

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

commit 053b95d94896a234a334ba0fb3dc610352ed22c5
Author:     Patrick Kelsey <pkelsey@FreeBSD.org>
AuthorDate: 2019-02-17 03:52:44 +0000
Commit:     Kyle Evans <kevans@FreeBSD.org>
CommitDate: 2021-10-08 02:41:05 +0000

    Remove whole-disk vdev support from zfsboot
    
    This is consistent with the removal of whole-disk vdev support from
    libsa/zfs/zfs.c in r342151, and is part way to having the LBAs read
    during probe be fully constrained by partition tables when present.
    
    (cherry picked from commit 861729a32e1a723ecfd2c5ba009d108879aa661b)
---
 stand/i386/zfsboot/zfsboot.c | 23 +++++------------------
 1 file changed, 5 insertions(+), 18 deletions(-)

diff --git a/stand/i386/zfsboot/zfsboot.c b/stand/i386/zfsboot/zfsboot.c
index d46934a4f059..25c0c1d8407a 100644
--- a/stand/i386/zfsboot/zfsboot.c
+++ b/stand/i386/zfsboot/zfsboot.c
@@ -595,32 +595,19 @@ probe_drive(struct zfsdsk *zdsk)
     char *sec;
     unsigned i;
 
-    /*
-     * If we find a vdev on the whole disk, stop here.
-     */
-    if (vdev_probe(vdev_read2, zdsk, NULL) == 0)
-	return;
-
 #ifdef LOADER_GELI_SUPPORT
     /*
-     * Taste the disk, if it is GELI encrypted, decrypt it and check to see if
-     * it is a usable vdev then. Otherwise dig
-     * out the partition table and probe each slice/partition
-     * in turn for a vdev or GELI encrypted vdev.
+     * Taste the disk, if it is GELI encrypted, decrypt it then dig out the
+     * partition table and probe each slice/partition in turn for a vdev or
+     * GELI encrypted vdev.
      */
     elba = drvsize_ext(zdsk);
     if (elba > 0) {
 	elba--;
     }
     zdsk->gdev = geli_taste(vdev_read, zdsk, elba, "disk%u:0:");
-    if (zdsk->gdev != NULL) {
-	if (geli_havekey(zdsk->gdev) == 0 || 
-	    geli_passphrase(zdsk->gdev, gelipw) == 0) {
-	    if (vdev_probe(vdev_read2, zdsk, NULL) == 0) {
-		return;
-	    }
-	}
-    }
+    if ((zdsk->gdev != NULL) && (geli_havekey(zdsk->gdev) == 0))
+	    geli_passphrase(zdsk->gdev, gelipw);
 #endif /* LOADER_GELI_SUPPORT */
 
     sec = dmadat->secbuf;