diff options
| author | Rich Felker <[email protected]> | 2020-08-31 15:32:08 +0000 |
|---|---|---|
| committer | Christian Brauner <[email protected]> | 2024-01-22 14:33:37 +0000 |
| commit | 73fa7547c70b32cc69685f79be31135797734eb6 (patch) | |
| tree | 61eca04ae3dafb7132f40baa1e73b27dd9f3f949 /fs/fs-writeback.c | |
| parent | selftests/move_mount_set_group:Make tests build with old libc (diff) | |
| download | kernel-73fa7547c70b32cc69685f79be31135797734eb6.tar.gz kernel-73fa7547c70b32cc69685f79be31135797734eb6.zip | |
vfs: add RWF_NOAPPEND flag for pwritev2
The pwrite function, originally defined by POSIX (thus the "p"), is
defined to ignore O_APPEND and write at the offset passed as its
argument. However, historically Linux honored O_APPEND if set and
ignored the offset. This cannot be changed due to stability policy,
but is documented in the man page as a bug.
Now that there's a pwritev2 syscall providing a superset of the pwrite
functionality that has a flags argument, the conforming behavior can
be offered to userspace via a new flag. Since pwritev2 checks flag
validity (in kiocb_set_rw_flags) and reports unknown ones with
EOPNOTSUPP, callers will not get wrong behavior on old kernels that
don't support the new flag; the error is reported and the caller can
decide how to handle it.
Signed-off-by: Rich Felker <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Reviewed-by: Jann Horn <[email protected]>
Signed-off-by: Christian Brauner <[email protected]>
Diffstat (limited to 'fs/fs-writeback.c')
0 files changed, 0 insertions, 0 deletions
