git: f6b47ffc1040 - stable/12 - loader: revert r342161 and r342151

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

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

commit f6b47ffc104053a16d60fdd2b7c81eb22e1e19de
Author:     Toomas Soome <tsoome@FreeBSD.org>
AuthorDate: 2020-10-22 20:02:02 +0000
Commit:     Kyle Evans <kevans@FreeBSD.org>
CommitDate: 2021-10-08 05:24:27 +0000

    loader: revert r342161 and r342151
    
    We are using asize property from pool label and we do not depend
    on partition data to find last two pool labels and to validate LBA for disk IO.
    
    This does allow us to re-enable support for partitionless disk setups.
    
    (cherry picked from commit e416eecbb9f7a5275d1d059ae720adc24af4d337)
---
 stand/libsa/zfs/zfs.c | 22 ++++------------------
 1 file changed, 4 insertions(+), 18 deletions(-)

diff --git a/stand/libsa/zfs/zfs.c b/stand/libsa/zfs/zfs.c
index edf74170491b..f74442138537 100644
--- a/stand/libsa/zfs/zfs.c
+++ b/stand/libsa/zfs/zfs.c
@@ -38,7 +38,6 @@ __FBSDID("$FreeBSD$");
 #include <sys/param.h>
 #include <sys/time.h>
 #include <sys/queue.h>
-#include <disk.h>
 #include <part.h>
 #include <stddef.h>
 #include <stdarg.h>
@@ -844,7 +843,6 @@ zfs_nextboot(void *vdev, char *buf, size_t size)
 int
 zfs_probe_dev(const char *devname, uint64_t *pool_guid)
 {
-	struct disk_devdesc *dev;
 	struct ptable *table;
 	struct zfs_probe_args pa;
 	uint64_t mediasz;
@@ -855,22 +853,10 @@ zfs_probe_dev(const char *devname, uint64_t *pool_guid)
 	pa.fd = open(devname, O_RDWR);
 	if (pa.fd == -1)
 		return (ENXIO);
-	/*
-	 * We will not probe the whole disk, we can not boot from such
-	 * disks and some systems will misreport the disk sizes and will
-	 * hang while accessing the disk.
-	 */
-	if (archsw.arch_getdev((void **)&dev, devname, NULL) == 0) {
-		int partition = dev->d_partition;
-		int slice = dev->d_slice;
-
-		free(dev);
-		if (partition != D_PARTNONE && slice != D_SLICENONE) {
-			ret = zfs_probe(pa.fd, pool_guid);
-			if (ret == 0)
-				return (0);
-		}
-	}
+	/* Probe the whole disk */
+	ret = zfs_probe(pa.fd, pool_guid);
+	if (ret == 0)
+		return (0);
 
 	/* Probe each partition */
 	ret = ioctl(pa.fd, DIOCGMEDIASIZE, &mediasz);