Don't forget to initialize the inode lock. This bug caused

surprisingly few problems.  Most fields were initialized to the
correct values by bzero(), but lk_prio was 0 instead of PINOD (=8),
the lk_wmsg was NULL instead of "ext2in", and lk_lockholder was 0
instead of -1.

Obtained from:	Lite2 via the -current ffs_vfsops.c
This commit is contained in:
bde 1998-09-09 13:09:24 +00:00
parent ee29b91274
commit a113660ecf
2 changed files with 2 additions and 0 deletions

View File

@ -938,6 +938,7 @@ ext2_vget(mp, ino, vpp)
return (error);
}
bzero((caddr_t)ip, sizeof(struct inode));
lockinit(&ip->i_lock, PINOD, "ext2in", 0, 0);
vp->v_data = ip;
ip->i_vnode = vp;
ip->i_e2fs = fs = ump->um_e2fs;

View File

@ -938,6 +938,7 @@ ext2_vget(mp, ino, vpp)
return (error);
}
bzero((caddr_t)ip, sizeof(struct inode));
lockinit(&ip->i_lock, PINOD, "ext2in", 0, 0);
vp->v_data = ip;
ip->i_vnode = vp;
ip->i_e2fs = fs = ump->um_e2fs;