From owner-freebsd-current@FreeBSD.ORG Thu Mar 4 17:26:45 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 29FE31065675; Thu, 4 Mar 2010 17:26:45 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: from harmony.bsdimp.com (bsdimp.com [199.45.160.85]) by mx1.freebsd.org (Postfix) with ESMTP id DDDEE8FC1A; Thu, 4 Mar 2010 17:26:44 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by harmony.bsdimp.com (8.14.3/8.14.1) with ESMTP id o24HHe1E002875; Thu, 4 Mar 2010 10:17:41 -0700 (MST) (envelope-from imp@bsdimp.com) Date: Thu, 04 Mar 2010 10:17:58 -0700 (MST) Message-Id: <20100304.101758.70320533242206105.imp@bsdimp.com> To: c.jayachandran@gmail.com From: "M. Warner Losh" In-Reply-To: <98a59be81003040504x6e97fbaeqeb10f8ea7bedb7b9@mail.gmail.com> References: <98a59be81003040504x6e97fbaeqeb10f8ea7bedb7b9@mail.gmail.com> X-Mailer: Mew version 6.3 on Emacs 22.3 / Mule 5.0 (SAKAKI) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Cc: sobomax@FreeBSD.org, freebsd-current@FreeBSD.org Subject: Re: newfs failure on -current 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: Thu, 04 Mar 2010 17:26:45 -0000 In message: <98a59be81003040504x6e97fbaeqeb10f8ea7bedb7b9@mail.gmail.com> "C. Jayachandran" writes: : I'm testing this on the mips platform, but I think there is an issue : with change that made sectorsize int64_t, because the ioctl : DIOCGSECTORSIZE used to read sector size seems to take u_int. This : quick change fixes it for me (sample patch - may be whitespace : damaged). : : Index: sbin/newfs/newfs.c : =================================================================== : --- sbin/newfs/newfs.c (revision 204687) : +++ sbin/newfs/newfs.c (working copy) : @@ -327,9 +327,11 @@ : mediasize = st.st_size; : /* set fssize from the partition */ : } else { : + u_int tsize; : if (sectorsize == 0) : - if (ioctl(disk.d_fd, DIOCGSECTORSIZE, §orsize) == -1) : + if (ioctl(disk.d_fd, DIOCGSECTORSIZE, &tsize) == -1) : sectorsize = 0; /* back out on error for safety */ : + sectorsize = tsize; : if (sectorsize && ioctl(disk.d_fd, DIOCGMEDIASIZE, : &mediasize) != -1) : getfssize(&fssize, special, mediasize / sectorsize, reserved); : } : Maybe the right change is to back out the DIOCGSECTORSIZE change due to silent breakage like this? Warner