Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 16 Dec 2018 08:58:15 +0000 (UTC)
From:      Toomas Soome <tsoome@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r342151 - head/stand/libsa/zfs
Message-ID:  <201812160858.wBG8wFSd032964@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: tsoome
Date: Sun Dec 16 08:58:14 2018
New Revision: 342151
URL: https://svnweb.freebsd.org/changeset/base/342151

Log:
  loader: zfs reader should not probe partitionless disks
  
  First of all, normal setups can not boot such pools as the tools
  do not support installing boot programs.
  
  Secondly, for proper pool configuration detection, we need to checks all
  four label copies on disk, 2 from front and 2 from the end of the disk,
  but zfs label does not contain the size of the disk - so we depend on
  firmware to report the correct disk size or use information from the
  partition table.
  
  Without partition table, we only can rely on firmware to report and support
  disk IO properly.
  
  There is a specific case: 8TB disks are reported by BIOS to have 4294967295
  sectors (0x00000000ffffffff), the sectors reported by OS is 15628053168
  (0x00000003a3812ab0), so the reported size is less than actual but is hitting
  32-bit max. Unfortuantely the real limit must be even lower because probing
  this disk in this system will wnd up with hung system.
  
  UEFI boot of this system seems not to be affected.
  
  Reviewed by:	imp
  MFC after:	2 weeks
  Differential Revision:	https://reviews.freebsd.org/D18558

Modified:
  head/stand/libsa/zfs/zfs.c

Modified: head/stand/libsa/zfs/zfs.c
==============================================================================
--- head/stand/libsa/zfs/zfs.c	Sun Dec 16 04:06:53 2018	(r342150)
+++ head/stand/libsa/zfs/zfs.c	Sun Dec 16 08:58:14 2018	(r342151)
@@ -527,10 +527,11 @@ zfs_probe_dev(const char *devname, uint64_t *pool_guid
 	pa.fd = open(devname, O_RDONLY);
 	if (pa.fd == -1)
 		return (ENXIO);
-	/* Probe the whole disk */
-	ret = zfs_probe(pa.fd, pool_guid);
-	if (ret == 0)
-		return (0);
+	/*
+	 * 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.
+	 */
 
 	/* Probe each partition */
 	ret = ioctl(pa.fd, DIOCGMEDIASIZE, &mediasz);



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201812160858.wBG8wFSd032964>