Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

V1.100 (Bug in NET2 dump and newly released dump)

4 views
Skip to first unread message

Keith Bostic

unread,
Jan 25, 1993, 9:06:25 PM1/25/93
to
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;

0 new messages