From owner-freebsd-current@FreeBSD.ORG Mon Mar 8 12:24:13 2010 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A40B11065670 for ; Mon, 8 Mar 2010 12:24:13 +0000 (UTC) (envelope-from gary.jennejohn@freenet.de) Received: from mout5.freenet.de (mout5.freenet.de [IPv6:2001:748:100:40::2:7]) by mx1.freebsd.org (Postfix) with ESMTP id 3D7C78FC14 for ; Mon, 8 Mar 2010 12:24:13 +0000 (UTC) Received: from [195.4.92.18] (helo=8.mx.freenet.de) by mout5.freenet.de with esmtpa (ID gary.jennejohn@freenet.de) (port 25) (Exim 4.72 #1) id 1Noc0J-0004tI-KA; Mon, 08 Mar 2010 13:24:11 +0100 Received: from p57ae2534.dip0.t-ipconnect.de ([87.174.37.52]:44753 helo=ernst.jennejohn.org) by 8.mx.freenet.de with esmtpa (ID gary.jennejohn@freenet.de) (port 25) (Exim 4.72 #2) id 1Noc0J-00085W-CT; Mon, 08 Mar 2010 13:24:11 +0100 Date: Mon, 8 Mar 2010 13:24:10 +0100 From: Gary Jennejohn To: "Poul-Henning Kamp" Message-ID: <20100308132410.0d99e0f3@ernst.jennejohn.org> In-Reply-To: <51125.1268049519@critter.freebsd.dk> References: <20100308125643.1ac0be0f@ernst.jennejohn.org> <51125.1268049519@critter.freebsd.dk> X-Mailer: Claws Mail 3.7.4 (GTK+ 2.16.2; amd64-portbld-freebsd9.0) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Cc: FreeBSD Current , "Jayachandran C." Subject: Re: newfs broken in -CURRENT after 204654 X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: gary.jennejohn@freenet.de List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 08 Mar 2010 12:24:13 -0000 On Mon, 08 Mar 2010 11:58:39 +0000 "Poul-Henning Kamp" wrote: > In message <20100308125643.1ac0be0f@ernst.jennejohn.org>, Gary Jennejohn writes > : > >On Mon, 8 Mar 2010 14:17:17 +0530 > > >> I'm trying this one more time, since the issue is still unresolved. > >> > >> newfs(8) broke for big-endian systems since revision 204654. This change > >> made sectorsize variable int64_t, and now it cannot be passed to the ioctl > >> DIOCGSECTORSIZE. > > This patch is correct, DIOCGSECTORSIZE takes an unsigned argument, see > : > > #define DIOCGSECTORSIZE _IOR('d', 128, u_int) > /*- > * Get the sectorsize of the device in bytes. The sectorsize is the > * smallest unit of data which can be transfered from this device. > * Usually this is a power of two but it may not be. (ie: CDROM audio) > */ > > > >I can't say whether this is correct, but the logic could definitely be > >simplified like this, since sectorsize is known to be 0 already: > > if (sectorsize == 0) > > if (ioctl(disk.d_fd, DIOCGSECTORSIZE, &tsecsize) >= 0) > > sectorsize = tsecsize; > > I'm not sure that is a valid assumption. > I disagree, but there's no reason to get into a bike-shed painting contest :) The original patch is OK the way it is. --- Gary Jennejohn