summaryrefslogtreecommitdiff
path: root/ufs-fsck/pass2.c
diff options
context:
space:
mode:
authorMichael I. Bushnell <mib@gnu.org>1994-10-13 00:04:57 +0000
committerMichael I. Bushnell <mib@gnu.org>1994-10-13 00:04:57 +0000
commitb5dd6d727cfec2909101a22a7f94ea4a07a065b3 (patch)
tree806a61c1e4005bf041e9b684ce6a60e107dcd595 /ufs-fsck/pass2.c
parent53ff1915c818303419c75432ac13c1f0019c5f2f (diff)
Formerly pass2.c.~5~
Diffstat (limited to 'ufs-fsck/pass2.c')
-rw-r--r--ufs-fsck/pass2.c15
1 files changed, 7 insertions, 8 deletions
diff --git a/ufs-fsck/pass2.c b/ufs-fsck/pass2.c
index f3353325..1bae70bc 100644
--- a/ufs-fsck/pass2.c
+++ b/ufs-fsck/pass2.c
@@ -172,7 +172,7 @@ pass2 ()
void *bufp;
int rewrite;
- readblock (fsbtodb (bno), buf, fsbtodb (nfrags));
+ readblock (fsbtodb (bno), buf, nfrags * sblock.fs_fsize);
rewrite = 0;
for (bufp = buf;
bufp - buf < nfrags * sblock->fs_fsize;
@@ -182,7 +182,7 @@ pass2 ()
rewrite = 1;
}
if (rewrite)
- writeblock (fsbtodb (bno), buf, fsbtodb (nfrags));
+ writeblock (fsbtodb (bno), buf, nfrags * sblock.fs_fsize);
return 1;
}
@@ -202,7 +202,7 @@ pass2 ()
errexit ("CANNOT ALLOCATE ROOT INODE\n");
break;
- case FILE:
+ case REG:
pfatal ("ROOT INODE NOT DIRECTORY");
if (reply ("REALLOCATE"))
freeino (ROOTINO);
@@ -235,9 +235,8 @@ pass2 ()
continue;
if (dnp->i_isize % DIRBLKSIZ)
{
- getpathname (pathbuf, dnp->i_number, dnp->i_number);
- pwarn ("DIRECTORY %s: LENGTH %d NOT MULTIPLE OF %d",
- pathbuf, dnp->i_isize, DIRBLKSIZ);
+ pwarn ("DIRECTORY INO=%d: LENGTH %d NOT MULTIPLE OF %d",
+ dnp->i_number, dnp->i_isize, DIRBLKSIZ);
if (preen || reply ("ADJUST"))
{
if (preen)
@@ -256,7 +255,7 @@ pass2 ()
/* At this point for each directory:
If this directory is an entry in another directory, then i_parent is
- set to that nodes directory.
+ set to that node's number.
If this directory has a `..' entry, then i_dotdot is set to that link.
Check to see that `..' is set correctly. */
for (nd = 0; nd < dirarrayused; nd++)
@@ -273,7 +272,7 @@ pass2 ()
fileerror (dnp->i_parent, dnp->i_number, "MISSING `..'");
if (reply ("FIX"))
makeentry (dnp->i_number, dnp->i_parent, "..");
-}
+ }
else if (dnp->i_parent && dnp->i_dotdot != dnp->i_parent)
{
fileerror (dnp->i_parent, dnp->i_number,