From owner-freebsd-geom@FreeBSD.ORG Mon Jun 20 21:19:04 2011 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 313241065673 for ; Mon, 20 Jun 2011 21:19:04 +0000 (UTC) (envelope-from mavbsd@gmail.com) Received: from mail-fx0-f54.google.com (mail-fx0-f54.google.com [209.85.161.54]) by mx1.freebsd.org (Postfix) with ESMTP id ACB668FC23 for ; Mon, 20 Jun 2011 21:19:03 +0000 (UTC) Received: by fxm11 with SMTP id 11so2575747fxm.13 for ; Mon, 20 Jun 2011 14:19:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:sender:message-id:date:from:user-agent :mime-version:to:cc:subject:references:in-reply-to:content-type :content-transfer-encoding; bh=+hpL0OUHxIboa5Mj73eHfisDuRpuWT6rXJPcb4SO2ss=; b=Fdc/DSv3QMZzqguY+aVVyKxSehB9KJBiqpFFA6xnzKYNuWsNVpvemF1jxw+G+raSDM V5kXm0Yxe3XO9telGfKhh3BHOdfXFokLcvx9IyN++DGGs+onBSj1WVNNH6VREbmj9+xG pTVfzV1WPjiSPgkPzD/VW/1tBQwynmxfy3TPw= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=sender:message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:content-type:content-transfer-encoding; b=Ht1G013Mp8IVIBU7INYVkY88dbNwLSOl1XQy/AxbFUasxpvctwVlQ5eDIUR69g89HU 8bCWHTMoLyapYRc9CaT7/gRgwdBq8lZ50S5XdJh/wSdJrCoG/FhoOwlxhS9BZOxt+W4T Jn9D9KZ47bQPMhavXA0iSKXnAILc7ELTCMwA8= Received: by 10.223.98.5 with SMTP id o5mr1388597fan.33.1308602596118; Mon, 20 Jun 2011 13:43:16 -0700 (PDT) Received: from mavbook.mavhome.dp.ua (pc.mavhome.dp.ua [212.86.226.226]) by mx.google.com with ESMTPS id l26sm3018512fah.14.2011.06.20.13.43.13 (version=SSLv3 cipher=OTHER); Mon, 20 Jun 2011 13:43:14 -0700 (PDT) Sender: Alexander Motin Message-ID: <4DFFB0DD.5070701@FreeBSD.org> Date: Mon, 20 Jun 2011 23:43:09 +0300 From: Alexander Motin User-Agent: Mozilla/5.0 (X11; U; FreeBSD amd64; en-US; rv:1.9.2.17) Gecko/20110616 Thunderbird/3.1.10 MIME-Version: 1.0 To: d@delphij.net References: <4DFF8611.4090705@pcbsd.org> <4DFF8DC6.1010701@FreeBSD.org> <4DFFA14F.4030402@delphij.net> In-Reply-To: <4DFFA14F.4030402@delphij.net> Content-Type: text/plain; charset=KOI8-R; format=flowed Content-Transfer-Encoding: 7bit Cc: "Andrey V. Elsukov" , Xin LI , freebsd-geom@freebsd.org Subject: Re: gpart sizes way off 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: Mon, 20 Jun 2011 21:19:04 -0000 On 20.06.2011 22:36, Xin LI wrote: > -----BEGIN PGP SIGNED MESSAGE----- > Hash: SHA256 > > On 06/20/11 11:13, Andrey V. Elsukov wrote: >> On 20.06.2011 21:40, Kris Moore wrote: >>> >>> Not sure if this has been reported, apologies if I'm late to noticing this. >>> >>> I'm not sure if something has changed in the past few weeks on CURRENT >>> to cause this, or if we are just noticing it for the first time, but >>> when doing installs and using "gpart add" for creating partitions on a >>> 2nd MBR slice, the sizes we are giving it are WAY off what actually is >>> allocated. For example: >>> >>> # gpart add -s 2048M -t freebsd-ufs -i 1 /dev/ada0s2 >>> ada0s2a added >>> # gpart add -s 1534M -t freebsd-swap -i 2 /dev/ada0s2 >>> ada0s2b added >>> # gpart add -s 2048M -t freebsd-ufs -i 4 /dev/ada0s2 >>> ada0s2d added >>> # gpart add -s 97165M -t freebsd-ufs -i 5 /dev/ada0s2 >>> gpart: autofill: No space left on device >> >> Which revision do you use? >> Also, please, show the output of `gpart list` and `geom disk list`. > > I can reproduce the problem on -CURRENT however the cause seems to be a > weird one. > > Attached is a (workaround?) for this issue. > > The revision 201645 seems to have exposed this problem -- when there is > no stripesize, the part class exposes the absolute offset when > stripesize == 0, while what gpart really want to do is to align against > a stripe, where the stripesize is not really meaningful here. > > Alexander, would you please help to review my patch? I think it is also not good. It will ignore useful absolute offset in case if user specified wanted alignment on command line. Proper fix I think would be in adding there: offset %= alignment; -- Alexander Motin