From owner-freebsd-current@FreeBSD.ORG Thu Mar 4 13:31:22 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 26C78106564A; Thu, 4 Mar 2010 13:31:22 +0000 (UTC) (envelope-from c.jayachandran@gmail.com) Received: from mail-pz0-f199.google.com (mail-pz0-f199.google.com [209.85.222.199]) by mx1.freebsd.org (Postfix) with ESMTP id EBD568FC15; Thu, 4 Mar 2010 13:31:21 +0000 (UTC) Received: by pzk37 with SMTP id 37so1753900pzk.7 for ; Thu, 04 Mar 2010 05:31:13 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:date:message-id:subject :from:to:cc:content-type; bh=ua/rhExbyYzFbLD+nz3GJv3Hgz5pkXNJimSI6rTITRk=; b=mpo13LInkqtnU66xOhgITnMHHM7yynPY7b/mH2MEfJdKr6pPEN3XtCuqZtQYjwdxqr Ar2Tf29pJfbVzVTCBkXCYl3DDnWDXWmHFqYAu03gb0q+cD6K641W8xAlE6x1xEy7aoZ7 taGT4/+SaJCuTfom0stRiGPSHWdW0hyC//i08= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:cc:content-type; b=HXMvrBB5M6R80ECyBwTMWX87l8wnO0YFFBir3xHqL5fbTGjIfjUxSX1UgTNo7iXoqr 2A3vZB4xY5li6KKnPDUOMgvNj6gpJbfafB0RGSjKwrtugfQ07v6kEBfprs+DwGv1raeN XNWXM2eKsePEmHiw0N9vJuONL4ofUuBuuPHSE= MIME-Version: 1.0 Received: by 10.141.101.12 with SMTP id d12mr5162746rvm.239.1267707843216; Thu, 04 Mar 2010 05:04:03 -0800 (PST) Date: Thu, 4 Mar 2010 18:34:03 +0530 Message-ID: <98a59be81003040504x6e97fbaeqeb10f8ea7bedb7b9@mail.gmail.com> From: "C. Jayachandran" To: sobomax@freebsd.org Content-Type: text/plain; charset=ISO-8859-1 Cc: FreeBSD Current Subject: 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 13:31:22 -0000 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); } Regards, JC.