]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
vfs_hash_insert: ensure that predicate is true
authorKonstantin Belousov <kib@FreeBSD.org>
Tue, 17 Aug 2021 13:47:25 +0000 (16:47 +0300)
committerKonstantin Belousov <kib@FreeBSD.org>
Fri, 27 Aug 2021 15:39:45 +0000 (18:39 +0300)
commit7c1e4aab7934933f0669c2b922976b30ed628a3f
treeee2117ff8451c0990f92c709f70d50df6b33dc1f
parent85fb840ebf3c213e45939188303bd5fe0aca4422
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
sys/kern/vfs_hash.c