From owner-freebsd-current@FreeBSD.ORG Mon Mar 8 11:58:41 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 64E151065677 for ; Mon, 8 Mar 2010 11:58:41 +0000 (UTC) (envelope-from phk@critter.freebsd.dk) Received: from phk.freebsd.dk (phk.freebsd.dk [130.225.244.222]) by mx1.freebsd.org (Postfix) with ESMTP id 2864A8FC1C for ; Mon, 8 Mar 2010 11:58:40 +0000 (UTC) Received: from critter.freebsd.dk (critter.freebsd.dk [192.168.61.3]) by phk.freebsd.dk (Postfix) with ESMTP id C314C643A; Mon, 8 Mar 2010 11:58:39 +0000 (UTC) Received: from critter.freebsd.dk (localhost [127.0.0.1]) by critter.freebsd.dk (8.14.3/8.14.3) with ESMTP id o28BwdKo051126; Mon, 8 Mar 2010 11:58:39 GMT (envelope-from phk@critter.freebsd.dk) To: gary.jennejohn@freenet.de From: "Poul-Henning Kamp" In-Reply-To: Your message of "Mon, 08 Mar 2010 12:56:43 +0100." <20100308125643.1ac0be0f@ernst.jennejohn.org> Date: Mon, 08 Mar 2010 11:58:39 +0000 Message-ID: <51125.1268049519@critter.freebsd.dk> Sender: phk@critter.freebsd.dk 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 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 11:58:41 -0000 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. -- Poul-Henning Kamp | UNIX since Zilog Zeus 3.20 phk@FreeBSD.ORG | TCP/IP since RFC 956 FreeBSD committer | BSD since 4.3-tahoe Never attribute to malice what can adequately be explained by incompetence.