Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 1 Nov 2017 18:49:45 +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: r325286 - head/sys/boot/efi/libefi
Message-ID:  <201711011849.vA1Injt3060287@repo.freebsd.org>

Next in thread | Raw E-Mail | Index | Archive | Help
Author: tsoome
Date: Wed Nov  1 18:49:45 2017
New Revision: 325286
URL: https://svnweb.freebsd.org/changeset/base/325286

Log:
  efipart_strategy is using wrong offset with >512B sectors
  
  The strategy() calls are assuming 512B sectors, so we need to adjust the
  offset accordingly.
  
  Reviewed by:	imp
  Differential Revision:	https://reviews.freebsd.org/D12849

Modified:
  head/sys/boot/efi/libefi/efipart.c

Modified: head/sys/boot/efi/libefi/efipart.c
==============================================================================
--- head/sys/boot/efi/libefi/efipart.c	Wed Nov  1 18:06:44 2017	(r325285)
+++ head/sys/boot/efi/libefi/efipart.c	Wed Nov  1 18:49:45 2017	(r325286)
@@ -877,7 +877,11 @@ efipart_strategy(void *devdata, int rw, daddr_t blk, s
 	bcd.dv_cache = pd->pd_bcache;
 
 	if (dev->d_dev->dv_type == DEVT_DISK) {
-		return (bcache_strategy(&bcd, rw, blk + dev->d_offset,
+		daddr_t offset;
+
+		offset = dev->d_offset * pd->pd_blkio->Media->BlockSize;
+		offset /= 512;
+		return (bcache_strategy(&bcd, rw, blk + offset,
 		    size, buf, rsize));
 	}
 	return (bcache_strategy(&bcd, rw, blk, size, buf, rsize));



Want to link to this message? Use this URL: <http://docs.FreeBSD.org/cgi/mid.cgi?201711011849.vA1Injt3060287>