HomeFreeBSD

fd: fix f_count acquire in fget_unlocked

Description

fd: fix f_count acquire in fget_unlocked

The code was using a hand-rolled fcmpset loop, while in other places the same
count is manipulated with the refcount API.

This transferred from a stylistic issue into a bug after the API got extended
to support flags. As a result the hand-rolled loop could bump the count high
enough to set the bit flag. Another bump + refcount_release would then free
the file prematurely.

The bug is only present in -CURRENT.

Details

Provenance
mjgAuthored on
Parents
rS357446: Fix up various vnode-related asserts which did not dump the used vnode
Branches
Unknown
Tags
Unknown