From owner-svn-src-head@freebsd.org Tue Oct 31 20:29:32 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 58EBEE62C67; Tue, 31 Oct 2017 20:29:32 +0000 (UTC) (envelope-from tsoome@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 26BF13F28; Tue, 31 Oct 2017 20:29:32 +0000 (UTC) (envelope-from tsoome@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v9VKTVm5097823; Tue, 31 Oct 2017 20:29:31 GMT (envelope-from tsoome@FreeBSD.org) Received: (from tsoome@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v9VKTV7P097822; Tue, 31 Oct 2017 20:29:31 GMT (envelope-from tsoome@FreeBSD.org) Message-Id: <201710312029.v9VKTV7P097822@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tsoome set sender to tsoome@FreeBSD.org using -f From: Toomas Soome Date: Tue, 31 Oct 2017 20:29:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r325248 - head/sys/boot/common X-SVN-Group: head X-SVN-Commit-Author: tsoome X-SVN-Commit-Paths: head/sys/boot/common X-SVN-Commit-Revision: 325248 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 31 Oct 2017 20:29:32 -0000 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. */