From owner-svn-src-all@FreeBSD.ORG Mon May 23 06:29:36 2011 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 37C37106564A; Mon, 23 May 2011 06:29:36 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from mgat.kirov.so-cdu.ru (mgat.kirov.so-cdu.ru [77.72.136.147]) by mx1.freebsd.org (Postfix) with ESMTP id 985188FC0A; Mon, 23 May 2011 06:29:34 +0000 (UTC) Received: from kirov.so-cdu.ru ([172.21.81.1]RDNS failed) by mgat.kirov.so-cdu.ru with InterScan Message Security Suite; Mon, 23 May 2011 09:29:13 +0400 Received: by ns.kirov.so-cdu.ru (Postfix, from userid 1010) id 03549B83DB; Mon, 23 May 2011 09:29:12 +0400 (MSD) Received: from [10.118.3.52] (elsukov.kirov.oduur.so [10.118.3.52]) by ns.kirov.so-cdu.ru (Postfix) with ESMTP id C021FB83D4; Mon, 23 May 2011 09:29:11 +0400 (MSD) Message-ID: <4DD9F0A3.701@FreeBSD.org> Date: Mon, 23 May 2011 09:29:07 +0400 From: "Andrey V. Elsukov" User-Agent: Mozilla Thunderbird 1.5 (FreeBSD/20051231) MIME-Version: 1.0 To: Warner Losh References: <201105152003.p4FK3tnS050889@svn.freebsd.org> <20110522093302.GA2638@mole.fafoe.narf.at> <6AE10D76-AC2F-4D7B-A985-EE072949ECC4@xcllnt.net> <42C49AE5-C8EA-44A0-AF88-16130BACE912@bsdimp.com> In-Reply-To: <42C49AE5-C8EA-44A0-AF88-16130BACE912@bsdimp.com> X-Enigmail-Version: 1.1.1 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="------------enig36620514AC8740AB558698E3" Cc: Adrian Chadd , src-committers@FreeBSD.org, svn-src-all@FreeBSD.org, Marcel Moolenaar , Stefan Farfeleder , svn-src-head@FreeBSD.org Subject: Re: svn commit: r221972 - head/sys/geom/part X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 May 2011 06:29:36 -0000 This is an OpenPGP/MIME signed message (RFC 2440 and 3156) --------------enig36620514AC8740AB558698E3 Content-Type: text/plain; charset=KOI8-R Content-Transfer-Encoding: quoted-printable On 23.05.2011 6:29, Warner Losh wrote: > Looking at one of my flash drives that shows the problem: >=20 > da0: 15423MB (31588351 512 byte sectors: 255H 63S/T 1966C) GEOM_PART: p= artition 1 has end offset > beyond last LBA: 31588350 > 31588325 >=20 > So why does gpart think the last LBA is 25 less than it really is. Wel= l, let's do some sanity > checks first. fdisk -s da0 tells us: > I'm pretty sure this problem is due to a bug in g_part_mbr.c: >=20 > basetable->gpt_last =3D msize - (msize % basetable->gpt_sectors) - 1; >=20 > This is wrong, or at least it is a widely disregarded part of what make= s up an MBR. When I > correct the size, the geom code is fine. There's no requirement in MBR= that a partition end of > any particular boundary, although sometimes you'll find mistaken docume= ntation that suggests this > is the case. Reading between the lines at http://www.boot-us.com/gloss= 03.htm suggests that this > restriction was only for disks < 8GB in size (from the fact it said tha= t all the partitions can > be described with the CHS fields). This is one of the things I learned= when I tried to make > fdisk enforce that: this isn't a requirement of MBR as it is implemente= d in the wild today. There is another opinion: http://www.boot-us.com/gloss02.htm "There is the convention that partitions should always start and end on *= cylinder boundaries*." but "Linux and Windows NT/2000/XP/2003/Vista/2008/7 seem to have no problems = when partitions do not start or end on cylinder boundaries. However other operating systems (e.g= =2E DOS) expect that this convention is obeyed." What way will we choose? I prefer to: leave the choice to the user how partition should be aligned= , and remove automatic alignment to track boundaries from MBR (and probably from all other schem= es). --=20 WBR, Andrey V. Elsukov --=20 WBR, Andrey V. Elsukov --------------enig36620514AC8740AB558698E3 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.10 (MingW32) iQEcBAEBAgAGBQJN2fCnAAoJEAHF6gQQyKF6vj4IAK9k37OApJ5Ml+Rxlq8TFBvR 2U4WEwYn0gUwyAlgaeC0bwbD5YN/H1l94PiU5EUUQFQ/7bdPMrIMqnuOTVjNPuh2 5Od8TRBvUbGI1XeEV2NH++0rUFGMp+pht6ZT3QCv3Btvs0PfDx6Jp+wycIGyCQ7f Qt6dQAzMi6Iuu1Cx9+Cckjao94aJ9WSckhr/RAMJMZ+iubyjYL7pGdb15Xq4xoDZ FnXPHd2cD1VyiY+Hing025q/AwRDgpkcXnLXLgshkeWv2QHEWf2UUkHkp15JH4jz b6FVDc74aA5IFqQBQ+hSaxjNzSgHUcRSxzHkGd+bDreDwPcP3xPHvJHxbGsGhiI= =V3re -----END PGP SIGNATURE----- --------------enig36620514AC8740AB558698E3--