Date: Mon, 23 May 2011 20:50:14 +0400 From: "Andrey V. Elsukov" <bu7cher@yandex.ru> To: Warner Losh <imp@bsdimp.com> Cc: Marcel Moolenaar <marcel@freebsd.org>, Poul-Henning Kamp <phk@freebsd.org>, freebsd-geom@freebsd.org Subject: Re: [RFC] Remove requirement of alignment to track from MBR scheme Message-ID: <4DDA9046.8050902@yandex.ru> In-Reply-To: <6DF62987-141B-4BB3-8E8D-9966EBAC828B@bsdimp.com> References: <4DDA2F0B.2040203@yandex.ru> <6DF62987-141B-4BB3-8E8D-9966EBAC828B@bsdimp.com>
next in thread | previous in thread | raw e-mail | index | archive | help
[-- Attachment #1 --] On 23.05.2011 20:14, Warner Losh wrote: > Since we don't have a good review tool for the project, this may seem a > little fragmented, but here goes: > > + if (pp->sectorsize > 4096) > + return (EOPNOTSUPP); > > What's the motivation for this? This seems unrelated to the problem at > hand. It may be good, but 4096-byte sector size is very new and I'm not > sure MS-DOS can cope... :) There has been a long tradition in the MBR, > however, of supporting different sector sizes to allow old-old-old > school floppies that had 128 or 256 byte sectors to work, as well as > allowing the supper-compressed 1.77MB floppies to work with their > 1024-byte (or was that 2048-byte?) sectors. Not sure this really > matters for reading, and for writing this case is so far beyond the edge > I'm not even sure why I bring it up[*] We have similar check in the g_part_mbr_probe function, and since we do not support sectorsize > 4096 in the probe method, i do not think we should try to create MBR for these providers. > In any event, I'd be tempted to use a #define for 4096 like > MBR_MAX_SECTOR_SIZE. > > - msize = MIN(pp->mediasize / pp->sectorsize, UINT32_MAX); > + msize = MIN(pp->mediasize / pp->sectorsize, 2 * UINT32_MAX); > > Why this change? I think that it is in two places. Currently we have limit to msize = UINT32_MAX, but partition in MBR has start offset and size (not end offset). Theoretically it can have size that is up to UINT32_MAX sectors, also start offset can be UINT32_MAX. And for example, for 4T disk we can have 2 partitions with 2TB size. -- WBR, Andrey V. Elsukov [-- Attachment #2 --] -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.17 (FreeBSD) iQEcBAEBAgAGBQJN2pBLAAoJEAHF6gQQyKF6gVUH/iNhIq4mBZbwY2tIQrcD6wo5 z/OaKTaV/TtfEd5T/0Kj5AKSUw/w2o+uK8ANPk1lucou/fpl6k5vIuQ/X3ZAA8ub Pijq0Cuj07wJahOz+JOEeR4cOoOlp4Qk5ifVsGuXR7SzUwuVecy+Zc91iZk1Oa0e P4NhyZSutUcya60jp9kiR9xt5ESl4V3R7pD0zJV8+ajzwBJ3JZwneGPX2n8IpA0U Iz+gAWXyzXyxzuPwSzCmw6uLa4OYqB8+0vrHrYQxLp21a50zqwh/LFgQPFyTYuYn +KxqTtkOmUM8HZvaztq9Sg+ub/WivYrouwSCyBNKkRqWvSZryfX1MrEint2J09g= =iDps -----END PGP SIGNATURE-----
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?4DDA9046.8050902>
