From owner-freebsd-geom@FreeBSD.ORG Tue Jun 15 23:04:16 2010 Return-Path: Delivered-To: freebsd-geom@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1870B1065672; Tue, 15 Jun 2010 23:04:16 +0000 (UTC) (envelope-from xcllnt@mac.com) Received: from asmtpout024.mac.com (asmtpout024.mac.com [17.148.16.99]) by mx1.freebsd.org (Postfix) with ESMTP id F00E98FC0C; Tue, 15 Jun 2010 23:04:15 +0000 (UTC) MIME-version: 1.0 Content-transfer-encoding: 7BIT Content-type: text/plain; charset=us-ascii Received: from [172.24.241.207] (natint3.juniper.net [66.129.224.36]) by asmtp024.mac.com (Sun Java(tm) System Messaging Server 6.3-8.01 (built Dec 16 2008; 32bit)) with ESMTPSA id <0L4200FQPW32CG80@asmtp024.mac.com>; Tue, 15 Jun 2010 16:04:15 -0700 (PDT) X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 ipscore=0 phishscore=0 bulkscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx engine=6.0.2-1004200000 definitions=main-1006150156 X-Proofpoint-Virus-Version: vendor=fsecure engine=1.12.8161:2.4.5,1.2.40,4.0.166 definitions=2010-06-15_03:2010-02-06, 2010-06-15, 2010-06-15 signatures=0 From: Marcel Moolenaar In-reply-to: <4C1743BB.6030105@yandex.ru> Date: Tue, 15 Jun 2010 16:04:13 -0700 Message-id: <38A1A2C1-FB5A-4578-A479-2D4D429E937A@mac.com> References: <4C1743BB.6030105@yandex.ru> To: "Andrey V. Elsukov" X-Mailer: Apple Mail (2.1078) Cc: Alexander Motin , Marcel Moolenaar , Konstantin Belousov , freebsd-geom@freebsd.org Subject: Re: RFC: make gpart(8) sector size aware X-BeenThere: freebsd-geom@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: GEOM-specific discussions and implementations List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Jun 2010 23:04:16 -0000 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