diff options
author | tegge <tegge@FreeBSD.org> | 2005-09-12 01:48:57 +0000 |
---|---|---|
committer | tegge <tegge@FreeBSD.org> | 2005-09-12 01:48:57 +0000 |
commit | 0075736656c5be8a6e96a4a496295fd4cf3130ac (patch) | |
tree | 5d530498cf07317319597429d0d7a82385f622c9 | |
parent | 16d6733e0be48bcba2c827136d536fadff76f1c3 (diff) | |
download | FreeBSD-src-0075736656c5be8a6e96a4a496295fd4cf3130ac.zip FreeBSD-src-0075736656c5be8a6e96a4a496295fd4cf3130ac.tar.gz |
Don't retry when vget() returns ENOENT in the nonblocking case due to the
vnode being doomed. It causes a livelock.
-rw-r--r-- | sys/kern/vfs_hash.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/kern/vfs_hash.c b/sys/kern/vfs_hash.c index bedbe44..c26c4c8 100644 --- a/sys/kern/vfs_hash.c +++ b/sys/kern/vfs_hash.c @@ -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); |