diff options
-rw-r--r-- | sbin/fsck/inode.c | 5 | ||||
-rw-r--r-- | sbin/fsck_ffs/inode.c | 5 | ||||
-rw-r--r-- | sbin/fsck_ifs/inode.c | 5 |
3 files changed, 9 insertions, 6 deletions
diff --git a/sbin/fsck/inode.c b/sbin/fsck/inode.c index e241cdb..8b2f14b 100644 --- a/sbin/fsck/inode.c +++ b/sbin/fsck/inode.c @@ -307,7 +307,7 @@ ginode(inumber) * Special purpose version of ginode used to optimize first pass * over all the inodes in numerical order. */ -ino_t nextino, lastinum; +ino_t nextino, lastinum, lastvalidinum; long readcnt, readpercg, fullcnt, inobufsize, partialcnt, partialsize; struct dinode *inodebuf; @@ -319,7 +319,7 @@ getnextinode(inumber) ufs_daddr_t dblk; static struct dinode *dp; - if (inumber != nextino++ || inumber > maxino) + if (inumber != nextino++ || inumber > lastvalidinum) errx(EEXIT, "bad inode number %d to nextinode", inumber); if (inumber >= lastinum) { readcnt++; @@ -348,6 +348,7 @@ setinodebuf(inum) if (inum % sblock.fs_ipg != 0) errx(EEXIT, "bad inode number %d to setinodebuf", inum); + lastvalidinum = inum + sblock.fs_ipg - 1; startinum = 0; nextino = inum; lastinum = inum; diff --git a/sbin/fsck_ffs/inode.c b/sbin/fsck_ffs/inode.c index e241cdb..8b2f14b 100644 --- a/sbin/fsck_ffs/inode.c +++ b/sbin/fsck_ffs/inode.c @@ -307,7 +307,7 @@ ginode(inumber) * Special purpose version of ginode used to optimize first pass * over all the inodes in numerical order. */ -ino_t nextino, lastinum; +ino_t nextino, lastinum, lastvalidinum; long readcnt, readpercg, fullcnt, inobufsize, partialcnt, partialsize; struct dinode *inodebuf; @@ -319,7 +319,7 @@ getnextinode(inumber) ufs_daddr_t dblk; static struct dinode *dp; - if (inumber != nextino++ || inumber > maxino) + if (inumber != nextino++ || inumber > lastvalidinum) errx(EEXIT, "bad inode number %d to nextinode", inumber); if (inumber >= lastinum) { readcnt++; @@ -348,6 +348,7 @@ setinodebuf(inum) if (inum % sblock.fs_ipg != 0) errx(EEXIT, "bad inode number %d to setinodebuf", inum); + lastvalidinum = inum + sblock.fs_ipg - 1; startinum = 0; nextino = inum; lastinum = inum; diff --git a/sbin/fsck_ifs/inode.c b/sbin/fsck_ifs/inode.c index e241cdb..8b2f14b 100644 --- a/sbin/fsck_ifs/inode.c +++ b/sbin/fsck_ifs/inode.c @@ -307,7 +307,7 @@ ginode(inumber) * Special purpose version of ginode used to optimize first pass * over all the inodes in numerical order. */ -ino_t nextino, lastinum; +ino_t nextino, lastinum, lastvalidinum; long readcnt, readpercg, fullcnt, inobufsize, partialcnt, partialsize; struct dinode *inodebuf; @@ -319,7 +319,7 @@ getnextinode(inumber) ufs_daddr_t dblk; static struct dinode *dp; - if (inumber != nextino++ || inumber > maxino) + if (inumber != nextino++ || inumber > lastvalidinum) errx(EEXIT, "bad inode number %d to nextinode", inumber); if (inumber >= lastinum) { readcnt++; @@ -348,6 +348,7 @@ setinodebuf(inum) if (inum % sblock.fs_ipg != 0) errx(EEXIT, "bad inode number %d to setinodebuf", inum); + lastvalidinum = inum + sblock.fs_ipg - 1; startinum = 0; nextino = inum; lastinum = inum; |