Subject: bin/21208: quotacheck fails after UFS2 merge
To: None <gnats-bugs@gnats.netbsd.org>
From: None <gcw@primenet.com.au>
List: netbsd-bugs
Date: 04/17/2003 15:45:35
>Number:         21208
>Category:       bin
>Synopsis:       quotacheck fails after UFS2 merge
>Confidential:   no
>Severity:       serious
>Priority:       high
>Responsible:    bin-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Thu Apr 17 05:46:01 UTC 2003
>Closed-Date:
>Last-Modified:
>Originator:     Geoff C. Wing
>Release:        NetBSD 1.6R (2003/04/17)
>Organization:
Geoff Wing : <gcw@pobox.com>
Rxvt Stuff : <gcw@rxvt.org>
Zsh Stuff  : <gcw@zsh.org>
>Environment:
System: NetBSD sparkles.primenet.com.au 1.6R NetBSD 1.6R (SPARKLES) #0: Wed Apr 16 16:54:50 EST 2003 gcw@sparkles.primenet.com.au:/usr/netbsd/src/sys/arch/i386/compile/SPARKLES i386
Architecture: i386
Machine: i386
>Description:
	In the UFS2 merge for quotacheck a critical pair of lines was
	removed.  They set the nextino number to bypass ROOTINO.  This is
	necessary due to the main loop which expect upto ROOTINO inodes
	(quotacheck.c:380) to already have been bypassed.

	Without it, you'll get:
		quotacheck: bad inode number 2 to nextinode

>How-To-Repeat:
	run "quotacheck -a" on a FS with quotas
>Fix:
--- usr.sbin/quotacheck/quotacheck.c.org	2003-04-17 15:35:38.000000000 +1000
+++ usr.sbin/quotacheck/quotacheck.c	2003-04-17 15:36:51.000000000 +1000
@@ -704,6 +704,8 @@
 	if (inodebuf == NULL &&
 	    (inodebuf = malloc((unsigned)inobufsize)) == NULL)
 		errx(1, "Cannot allocate space for inode buffer");
+	while (nextino < ROOTINO)
+		getnextinode(nextino);
 }
 
 void
>Release-Note:
>Audit-Trail:
>Unformatted: