HomeFreeBSD

fcntl(F_SETFL): only allow one thread to perform F_SETFL

Description

fcntl(F_SETFL): only allow one thread to perform F_SETFL

Use f_vflags file locking for this.
Allowing more than one thread handling F_SETFL might cause de-sync
between real driver state and flags.

Reviewed by: markj
Tested by: pho
Sponsored by: The FreeBSD Foundation
MFC after: 2 weeks
Differential revision: https://reviews.freebsd.org/D52487

(cherry picked from commit 4c3a868d13c053ef173268cdfe1365978a282178)

Details

Provenance
kibAuthored on Sep 11 2025, 10:05 AM
jhbCommitted on Dec 18 2025, 5:01 PM
Reviewer
markj
Differential Revision
D52487: fcntl(F_SETFL): only allow one thread to perform F_SETFL
Parents
rGb3aada5bfdb9: fcntl(F_SETFL): Don't unconditionally invoke FIONBIO and FIOASYNC
Branches
Unknown
Tags
Unknown