RFC: make gpart(8) sector size aware
Andrey V. Elsukov
bu7cher at yandex.ru
Tue Jun 15 09:11:34 UTC 2010
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.
My patch is here:
http://people.freebsd.org/~ae/gpart_sectorsize.diff
Also I replaced `unsigned long long` type for `off_t` for unify code since
it seems off_t used for media size in libgeom(8) and for DIOCGMEDIASIZE ioctl.
--
WBR, Andrey V. Elsukov
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 488 bytes
Desc: OpenPGP digital signature
Url : http://lists.freebsd.org/pipermail/freebsd-geom/attachments/20100615/ce8f2a53/signature.pgp
More information about the freebsd-geom
mailing list