mirror of
https://github.com/freebsd/freebsd-src.git
synced 2024-12-04 01:38:57 +00:00
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:
parent
c50fe92b8d
commit
576365ba36
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=96082
@ -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.
|
||||
|
@ -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.
|
||||
|
Loading…
Reference in New Issue
Block a user