Eliminate the loop and the call to pause(9) in vfs_vget_ino(). If
vfs_busy(MBF_NOWAIT) failed, unlock the vnode and sleep in vfs_busy(). Suggested and reviewed by: jeff Tested by: pho MFC after: 3 weeks
This commit is contained in:
parent
541bfd6180
commit
41b72e6e50
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=191895
@ -1292,15 +1292,17 @@ vn_vget_ino(struct vnode *vp, ino_t ino, int lkflags, struct vnode **rvp)
|
||||
ltype = VOP_ISLOCKED(vp);
|
||||
KASSERT(ltype == LK_EXCLUSIVE || ltype == LK_SHARED,
|
||||
("vn_vget_ino: vp not locked"));
|
||||
for (;;) {
|
||||
error = vfs_busy(mp, MBF_NOWAIT);
|
||||
if (error == 0)
|
||||
break;
|
||||
error = vfs_busy(mp, MBF_NOWAIT);
|
||||
if (error != 0) {
|
||||
VOP_UNLOCK(vp, 0);
|
||||
pause("vn_vget", 1);
|
||||
error = vfs_busy(mp, 0);
|
||||
vn_lock(vp, ltype | LK_RETRY);
|
||||
if (vp->v_iflag & VI_DOOMED)
|
||||
if (error != 0)
|
||||
return (ENOENT);
|
||||
if (vp->v_iflag & VI_DOOMED) {
|
||||
vfs_unbusy(mp);
|
||||
return (ENOENT);
|
||||
}
|
||||
}
|
||||
VOP_UNLOCK(vp, 0);
|
||||
error = VFS_VGET(mp, ino, lkflags, rvp);
|
||||
|
Loading…
Reference in New Issue
Block a user