HomeFreeBSD

Intentionally allow ZFS_READONLY in zfs_write

Description

Intentionally allow ZFS_READONLY in zfs_write

ZFS_READONLY represents the "DOS R/O" attribute.
When that flag is set, we should behave as if write access
were not granted by anything in the ACL. In particular:
We _must_ allow writes after opening the file r/w, then
setting the DOS R/O attribute, and writing some more.
(Similar to how you can write after fchmod(fd, 0444).)

Restore these semantics which were lost on FreeBSD when refactoring
zfs_write. To my knowledge Linux does not actually expose this flag,
but we'll need it to eventually so I've added the supporting checks.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Ryan Moeller <ryan@iXsystems.com>
Closes #11693

Details

Provenance
freqlabsAuthored on Mar 7 2021, 5:31 PM
GitHub <noreply@github.com>Committed on Mar 7 2021, 5:31 PM
Parents
rGe7a06356c13c: Suppress cppcheck invalidSyntax warninigs
Branches
Unknown
Tags
Unknown