]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
fd: make serialization in fdescfree_fds conditional on hold count
authormjg <mjg@FreeBSD.org>
Thu, 10 Dec 2020 17:17:22 +0000 (17:17 +0000)
committermjg <mjg@FreeBSD.org>
Thu, 10 Dec 2020 17:17:22 +0000 (17:17 +0000)
commit1d5ab012710c4ad357a74cc05c91b05c6a925328
tree7e52d635c9de3ce93a5867871b3beef0620fb526
parent2333220ae1a71ce51429b9d206a765df0562c987
fd: make serialization in fdescfree_fds conditional on hold count

p_fd nullification in fdescfree serializes against new threads transitioning
the count 1 -> 2, meaning that fdescfree_fds observing the count of 1 can
safely assume there is nobody else using the table. Losing the race and
observing > 1 is harmless.

Reviewed by: markj
Differential Revision: https://reviews.freebsd.org/D27522
sys/kern/kern_descrip.c