🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: comp.bugs.4bsd.ucb-fixes
1 messages
1 total messages Started by Keith Bostic Tue, 26 Jan 1993 02:06
V1.100 (Bug in NET2 dump and newly released dump)
#11
Author: Keith Bostic
Date: Tue, 26 Jan 1993 02:06
73 lines
2299 bytes
Subject: Bug in NET2 dump and newly released dump.
Index: sbin/{dump,restore} 4.4BSD-alpha

Description:

	dumptraverse.c:mapfiles() contains a loop that begins with:

		for (ino = 0; ino < maxino; ino++) {
			dp = getino(ino);

	This contrasts with the loop in main() containing:

		for (map = dumpdirmap, ino = 0; ino < maxino; ) {
			dirty = GETDIRTY(ino)	/* Shortened for brevity. */
			ino++;
			if ((dirty & 1) == 0)
				continue;
			dp = getino(ino);	/* Work with dp. */		
		}

	and the subsequent loop using dumpinomap.

	While the loops in main() appear to be correct, the loop in
	mapfiles() can never invoke:

		SETINO(maxino, usedinomap)
	or 
		SETINO(maxino, dumpinomap);

	Changing the < to <= in mapfiles() (BUT NOT IN MAIN!!) fixes it.

Fix:
	Copies of the new dump/restore package are available by anonymous
	ftp from ftp.cs.berkeley.edu:ucb/4bsd/dump.restore.tar.Z.

	The following patch also fixes the problem.

*** traverse.c.old	Mon Jan 25 12:50:10 1993
--- traverse.c.new	Mon Jan 25 12:49:52 1993
***************
*** 32,38 ****
   */
  
  #ifndef lint
! static char sccsid[] = "@(#)traverse.c	5.21 (Berkeley) 7/19/92";
  #endif /* not lint */
  
  #ifdef sunos
--- 32,38 ----
   */
  
  #ifndef lint
! static char sccsid[] = "@(#)traverse.c	5.22 (Berkeley) 1/25/93";
  #endif /* not lint */
  
  #ifdef sunos
***************
*** 115,121 ****
  	register struct dinode *dp;
  	int anydirskipped = 0;
  
! 	for (ino = 0; ino < maxino; ino++) {
  		dp = getino(ino);
  		if ((mode = (dp->di_mode & IFMT)) == 0)
  			continue;
--- 115,121 ----
  	register struct dinode *dp;
  	int anydirskipped = 0;
  
! 	for (ino = 0; ino <= maxino; ino++) {
  		dp = getino(ino);
  		if ((mode = (dp->di_mode & IFMT)) == 0)
  			continue;
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads