Don't retry when vget() returns ENOENT in the nonblocking case due to the

vnode being doomed.  It causes a livelock.
This commit is contained in:
Tor Egge 2005-09-12 01:48:57 +00:00
parent 2f0ffabcf4
commit 6ff5e2db45
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=150011

View file

@ -79,7 +79,7 @@ vfs_hash_get(struct mount *mp, u_int hash, int flags, struct thread *td, struct
VI_LOCK(vp);
mtx_unlock(&vfs_hash_mtx);
error = vget(vp, flags | LK_INTERLOCK, td);
if (error == ENOENT)
if (error == ENOENT && (flags & LK_NOWAIT) == 0)
break;
if (error)
return (error);
@ -124,7 +124,7 @@ vfs_hash_insert(struct vnode *vp, u_int hash, int flags, struct thread *td, stru
VI_LOCK(vp2);
mtx_unlock(&vfs_hash_mtx);
error = vget(vp2, flags | LK_INTERLOCK, td);
if (error == ENOENT)
if (error == ENOENT && (flags & LK_NOWAIT) == 0)
break;
mtx_lock(&vfs_hash_mtx);
LIST_INSERT_HEAD(&vfs_hash_side, vp, v_hashlist);