Date: Tue, 15 Jun 2010 16:04:13 -0700 From: Marcel Moolenaar <xcllnt@mac.com> To: "Andrey V. Elsukov" <bu7cher@yandex.ru> Cc: Alexander Motin <mav@FreeBSD.org>, Marcel Moolenaar <marcel@FreeBSD.org>, Konstantin Belousov <kib@FreeBSD.org>, freebsd-geom@freebsd.org Subject: Re: RFC: make gpart(8) sector size aware Message-ID: <38A1A2C1-FB5A-4578-A479-2D4D429E937A@mac.com> In-Reply-To: <4C1743BB.6030105@yandex.ru> References: <4C1743BB.6030105@yandex.ru>
next in thread | previous in thread | raw e-mail | index | archive | help
On Jun 15, 2010, at 2:11 AM, Andrey V. Elsukov wrote: > Hi, All. > > I made a patch that makes gpart(8) sector size aware. > There is a known issue described in bin/146277. > > gpart(8) uses type ASCLBA for size-related params and it doesn't know > about provider's sector size when geom(8) parses arguments. By default > it assumes that sector size is 512 bytes. And when user specifies size or > start offset params in humanized form they being calculated into sectors > incorrectly. > > It seems that only gpart(8) uses G_TYPE_ASCLBA and there are none of another > consumers, so I deleted this type and replace it to G_TYPE_STRING. And now > gpart(8) converts size-related params after geom(8) when it can know provider's > sector size. Overall the approach is good, but it does go against what I think is the intend of geom and that is that gctl creating is handled in common code using the the tables. That's also why I introduced G_TYPE_ASCLBA. I'm fine with using G_TYPE_STRING and adding a bit of post-processing. FYI, -- Marcel Moolenaar xcllnt@mac.com
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?38A1A2C1-FB5A-4578-A479-2D4D429E937A>