svn commit: r325248 - head/sys/boot/common

Toomas Soome tsoome at FreeBSD.org
Tue Oct 31 20:29:32 UTC 2017


Author: tsoome
Date: Tue Oct 31 20:29:31 2017
New Revision: 325248
URL: https://svnweb.freebsd.org/changeset/base/325248

Log:
  loader ptblread() is broken with >512B sectors
  
  The loader strategy() function is assuming 512B blocks, so we need to adjust
  ptblread() for other sector sizes.
  
  Reviewed by:	imp
  Differential Revision:	https://reviews.freebsd.org/D12847

Modified:
  head/sys/boot/common/disk.c

Modified: head/sys/boot/common/disk.c
==============================================================================
--- head/sys/boot/common/disk.c	Tue Oct 31 19:52:30 2017	(r325247)
+++ head/sys/boot/common/disk.c	Tue Oct 31 20:29:31 2017	(r325248)
@@ -89,6 +89,12 @@ ptblread(void *d, void *buf, size_t blocks, uint64_t o
 	od = (struct open_disk *)dev->d_opendata;
 
 	/*
+	 * The strategy function assumes the offset is in units of 512 byte
+	 * sectors. For larger sector sizes, we need to adjust the offset to
+	 * match the actual sector size.
+	 */
+	offset *= (od->sectorsize / 512);
+	/*
 	 * As the GPT backup partition is located at the end of the disk,
 	 * to avoid reading past disk end, flag bcache not to use RA.
 	 */


More information about the svn-src-head mailing list