Re: newfs failure on -current

2010-03-04 Thread M. Warner Losh
In message: <98a59be81003040504x6e97fbaeqeb10f8ea7bedb...@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
___
freebsd-current@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to "freebsd-current-unsubscr...@freebsd.org"


newfs failure on -current

2010-03-04 Thread C. Jayachandran
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.
___
freebsd-current@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to "freebsd-current-unsubscr...@freebsd.org"