newfs failure on -current

From: C. Jayachandran <c.jayachandran_at_gmail.com>
Date: Thu, 4 Mar 2010 18:34:03 +0530
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)
_at__at_ -327,9 +327,11 _at__at_
                mediasize = st.st_size;
                /* set fssize from the partition */
        } else {
+           u_int tsize;
            if (sectorsize == 0)
-               if (ioctl(disk.d_fd, DIOCGSECTORSIZE, &sectorsize) == -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.
Received on Thu Mar 04 2010 - 12:31:22 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:40:01 UTC