Subject: A second newfs problem
To: None <tech-kern@netbsd.org>
From: Christopher SEKIYA <wileyc@rezrov.net>
List: tech-kern
Date: 10/12/2003 12:41:57
There seems to be a second, related problem with newfs: without specifying
-s, llsize isn't properly initialized.  This results in the sanity checks
around newfs.c:573 to do the wrong thing -- the way I see it (and please
correct me if I am wrong), if a size isn't explicitly specified newfs should
use all available space.

The attached patch initializes llsize, permits newfs to build filesystems
without explicit -s, and makes things like sysinst very happy.  I was unsure if
llsize should initially be zero or -1.

-- Chris
	GPG key FEB9DE7F (91AF 4534 4529 4BCC 31A5  938E 023E EEFB FEB9 DE7F)


Index: newfs.c
===================================================================
RCS file: /cvsroot/src/sbin/newfs/newfs.c,v
retrieving revision 1.73
diff -u -r1.73 newfs.c
--- newfs.c	2003/10/10 09:00:24	1.73
+++ newfs.c	2003/10/12 03:41:06
@@ -225,7 +225,7 @@
 	int ch, fsi, fso, len, maxpartitions, n, Fflag, Iflag, Zflag, Vflag;
 	char *cp, *endp, *s1, *s2, *special;
 	const char *opstring;
-	long long llsize;
+	long long llsize = 0;
 	int llsizemult;
 	int dfl_fragsize, dfl_blksize;
 #ifdef MFS