]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
fd: make serialization in fdescfree_fds conditional on hold count
authorMateusz Guzik <mjg@FreeBSD.org>
Thu, 10 Dec 2020 17:17:22 +0000 (17:17 +0000)
committerMateusz Guzik <mjg@FreeBSD.org>
Thu, 10 Dec 2020 17:17:22 +0000 (17:17 +0000)
commit0ecce93dca66c2a743dcd63f72276c5128aa5e99
tree7e52d635c9de3ce93a5867871b3beef0620fb526
parentc05b5848f11b4b551b104a183231409ed4874c66
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