Move a KASSERT() in open() prior to unlocking the vnode. It's not safe to

call VOP_GETVOBJECT without a lock.
This commit is contained in:
Jeff Roberson 2002-05-05 23:17:13 +00:00
parent c50fe92b8d
commit 576365ba36
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=96082
2 changed files with 8 additions and 6 deletions

View File

@ -1765,6 +1765,10 @@ open(td, uap)
return 0;
}
/* assert that vn_open created a backing object if one is needed */
KASSERT(!vn_canvmio(vp) || VOP_GETVOBJECT(vp, NULL) == 0,
("open: vmio vnode has no backing object after vn_open"));
fp->f_data = (caddr_t)vp;
fp->f_flag = flags & FMASK;
fp->f_ops = &vnops;
@ -1800,9 +1804,6 @@ open(td, uap)
if (error)
goto bad;
}
/* assert that vn_open created a backing object if one is needed */
KASSERT(!vn_canvmio(vp) || VOP_GETVOBJECT(vp, NULL) == 0,
("open: vmio vnode has no backing object after vn_open"));
/*
* Release our private reference, leaving the one associated with
* the descriptor table intact.

View File

@ -1765,6 +1765,10 @@ open(td, uap)
return 0;
}
/* assert that vn_open created a backing object if one is needed */
KASSERT(!vn_canvmio(vp) || VOP_GETVOBJECT(vp, NULL) == 0,
("open: vmio vnode has no backing object after vn_open"));
fp->f_data = (caddr_t)vp;
fp->f_flag = flags & FMASK;
fp->f_ops = &vnops;
@ -1800,9 +1804,6 @@ open(td, uap)
if (error)
goto bad;
}
/* assert that vn_open created a backing object if one is needed */
KASSERT(!vn_canvmio(vp) || VOP_GETVOBJECT(vp, NULL) == 0,
("open: vmio vnode has no backing object after vn_open"));
/*
* Release our private reference, leaving the one associated with
* the descriptor table intact.