HomeFreeBSD

vfs_hash_insert: ensure that predicate is true

Description

vfs_hash_insert: ensure that predicate is true

After vnode lock, recheck v_hash. When vfs_hash_insert() is used with
a predicate, recheck it after the selected vnode is locked. Since
vfs_hash_lock is dropped, vnode could be rehashed during the sleep for
the vnode lock, which could go unnoticed there.

Reported and tested by: pho
Reviewed by: mckusick, rmacklem
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D31464

Details

Provenance
kibAuthored on Aug 17 2021, 1:47 PM
Reviewer
mckusick
Differential Revision
D31464: Some fixes for msdosfs_rename and ufs_rename
Parents
rG85fb840ebf3c: msdosfs: drop now unused DE_RENAME
Branches
Unknown
Tags
Unknown