Skip to content

Commit

Permalink
vfs cache: denote a known bug in cache_remove_cnp
Browse files Browse the repository at this point in the history
  • Loading branch information
mjguzik committed Oct 5, 2023
1 parent 0f15054 commit cd2105d
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions sys/kern/vfs_cache.c
Original file line number Diff line number Diff line change
Expand Up @@ -1822,6 +1822,15 @@ cache_remove_cnp(struct vnode *dvp, struct componentname *cnp)
return (1);
}

/*
* XXX note that access here is completely unlocked with no provisions
* to keep the hash allocated. If one is sufficiently unlucky a
* parallel cache resize can reallocate the hash, unmap backing pages
* and cause the empty check below to fault.
*
* Fixing this has epsilon priority, but can be done with no overhead
* for this codepath with sufficient effort.
*/
hash = cache_get_hash(cnp->cn_nameptr, cnp->cn_namelen, dvp);
blp = HASH2BUCKETLOCK(hash);
retry:
Expand Down

0 comments on commit cd2105d

Please sign in to comment.