1
0
mirror of https://git.FreeBSD.org/src.git synced 2024-12-14 10:09:48 +00:00

Don't read an inode which isn't used to avoid problems on UFS2 where not

all inodes are initialized when running newfs.

Approved by:    grog (mentor)
This commit is contained in:
Lukas Ertl 2004-03-26 23:42:32 +00:00
parent 10d3ed6459
commit f055f9f2b2
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=127469

View File

@ -1836,6 +1836,10 @@ ginode(ino_t inumber, int fsi, int cg)
DBG_ENTER;
inumber += (cg * sblock.fs_ipg);
if (isclr(cg_inosused(&aocg), inumber)) {
DBG_LEAVE;
return NULL;
}
if (inumber < ROOTINO || inumber > maxino)
errx(8, "bad inode number %d to ginode", inumber);
if (startinum == 0 ||
@ -2374,6 +2378,10 @@ updrefs(int cg, ino_t in, struct gfs_bpp *bp, int fsi, int fso, unsigned int
* here by using the bitmap.
*/
ino = ginode(in, fsi, cg);
if (ino == NULL) {
DBG_LEAVE;
return;
}
mode = DIP(ino, di_mode) & IFMT;
if (mode != IFDIR && mode != IFREG && mode != IFLNK) {
DBG_LEAVE;