Skip to content

Commit

Permalink
Fixed recursive lock in vcache
Browse files Browse the repository at this point in the history
  • Loading branch information
mohrcore committed Jan 24, 2022
1 parent f82a87c commit a6b7923
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions sys/kern/vfs_vcache.c
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ vnode_t *vcache_hashget(mount_t *mp, ino_t ino) {

vnode_t *vn = NULL;
TAILQ_FOREACH (vn, &vcache_buckets[bucket], v_cached) {
if (vn->v_mount == mp && vn->v_ino == ino) {
if ((vn->v_mount == mp) && (vn->v_ino == ino)) {
TAILQ_REMOVE(&vcache_free, vn, v_free);
TAILQ_REMOVE(&vcache_buckets[bucket], vn, v_cached);
vnode_hold(vn);
Expand All @@ -70,8 +70,6 @@ static int vfs_vcache_remove_from_bucket(vnode_t *vn) {
vcache_t bucket = vcache_hash(vn->v_mount, vn->v_ino);
vnode_t *bucket_node = NULL;

SCOPED_MTX_LOCK(&vcache_giant_lock);

TAILQ_FOREACH (bucket_node, &vcache_buckets[bucket], v_cached) {
if (bucket_node == vn) {
TAILQ_REMOVE(&vcache_buckets[bucket], vn, v_cached);
Expand Down

0 comments on commit a6b7923

Please sign in to comment.