From a7779d7530edf79610c1fd4de905a277cbd3a720 Mon Sep 17 00:00:00 2001 From: "Michael I. Bushnell" Date: Tue, 18 Oct 1994 00:33:00 +0000 Subject: Formerly pass2.c.~9~ --- ufs-fsck/pass2.c | 6 ++++-- 1 file 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)) -- cgit v1.2.3