HomeFreeBSD

During F_SETFL, don't change file flags on error

Description

During F_SETFL, don't change file flags on error

Previously, even if the FIONBIO or FIOASYNC ioctl failed, the file's
f_flags variable would still be changed. Now, kern_fcntl will restore
the original flags if the ioctl fails.

PR: 265736
Reported by: Yuval Pavel Zholkover <paulzhol@gmail.com>
Reviewed by: kib
Differential Revision: https://reviews.freebsd.org/D40955

(cherry picked from commit 6c049996ec29bad4a913b019a28f211ab84b0d3d)

Details

Provenance
asomersAuthored on Jul 9 2023, 8:48 PM
Reviewer
kib
Differential Revision
D40955: During F_SETFL, don't change file flags on error
Parents
rGb2c207ddfc45: Fix the zfsd_autoreplace_001_neg test
Branches
Unknown
Tags
Unknown