summaryrefslogtreecommitdiff
path: root/ufs-fsck
diff options
context:
space:
mode:
authorMichael I. Bushnell <mib@gnu.org>1994-10-18 00:33:00 +0000
committerMichael I. Bushnell <mib@gnu.org>1994-10-18 00:33:00 +0000
commita7779d7530edf79610c1fd4de905a277cbd3a720 (patch)
treeb80e08f1b4ed04f2e34549e2795c06a863c219b7 /ufs-fsck
parent563e3b7581bf9fe857c88dc0a51f3b454a4ecb57 (diff)
Formerly pass2.c.~9~
Diffstat (limited to 'ufs-fsck')
-rw-r--r--ufs-fsck/pass2.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/ufs-fsck/pass2.c b/ufs-fsck/pass2.c
index a261ff1d..a04b475e 100644
--- a/ufs-fsck/pass2.c
+++ b/ufs-fsck/pass2.c
@@ -177,9 +177,10 @@ pass2 ()
/* Called for each filesystem block of the directory. Load BNO
into core and then call CHECK1BLOCK for each DIRBLKSIZ chunk.
+ OFFSET is the offset this block occupies ithe file.
Always return 1. */
int
- checkdirblock (daddr_t bno, int nfrags)
+ checkdirblock (daddr_t bno, int nfrags, off_t offset)
{
void *buf = alloca (nfrags * sblock->fs_fsize);
void *bufp;
@@ -188,7 +189,8 @@ pass2 ()
readblock (fsbtodb (sblock, bno), buf, nfrags * sblock->fs_fsize);
rewrite = 0;
for (bufp = buf;
- bufp - buf < nfrags * sblock->fs_fsize;
+ bufp - buf < nfrags * sblock->fs_fsize
+ && offset + (bufp - buf) + DIRBLKSIZ <= dnp->i_isize;
bufp += DIRBLKSIZ)
{
if (check1block (bufp))