From: Xi Ruoyao Date: Thu, 28 Aug 2025 05:56:40 +0000 (+0800) Subject: misc: Add support for Linux uio.h RWF_DONTCACHE flag X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=3b39822a82a2415f92ddbc1503e4a55597034573;p=thirdparty%2Fglibc.git misc: Add support for Linux uio.h RWF_DONTCACHE flag Linux 6.14 adds the new flag for uncached buffered IO on a filesystem supporting it. This caused two test failures as these tests expected the flag 0x00000080 is unused. Add the flag definition to fix these tests on Linux >= 6.14: FAIL: misc/tst-preadvwritev2 FAIL: misc/tst-preadvwritev64v2 The test failures were not detected in routine test suite runs because normally we create the test file in /tmp, where a tmpfs is usually mounted, and tmpfs does not support this flag. But it can be reproduced with TMPDIR set to some directory in an ext4 file system. Link: https://git.kernel.org/torvalds/c/af6505e5745b Signed-off-by: Xi Ruoyao Reviewed-by: Adhemerval Zanella --- diff --git a/manual/llio.texi b/manual/llio.texi index e7fd6ca0e9..806ff0a27d 100644 --- a/manual/llio.texi +++ b/manual/llio.texi @@ -1414,6 +1414,10 @@ naturally-aligned with regard to total write length. The @code{atomic_*} values can be obtained with @code{statx} along with @code{STATX_WRITE_ATOMIC} flag. +@item RWF_DONTCACHE +Use uncached buffered IO. If the file system does not support it, the +call will fail and set @code{errno} to @code{EOPNOTSUPP}. + This is a Linux-specific extension. @end vtable diff --git a/misc/tst-preadvwritev2-common.c b/misc/tst-preadvwritev2-common.c index ff1007d6d2..8a59ff2f9d 100644 --- a/misc/tst-preadvwritev2-common.c +++ b/misc/tst-preadvwritev2-common.c @@ -40,8 +40,12 @@ #ifndef RWF_ATOMIC # define RWF_ATOMIC 0 #endif +#ifndef RWF_DONTCACHE +# define RWF_DONTCACHE 0 +#endif #define RWF_SUPPORTED (RWF_HIPRI | RWF_DSYNC | RWF_SYNC | RWF_NOWAIT \ - | RWF_APPEND | RWF_NOAPPEND | RWF_ATOMIC) + | RWF_APPEND | RWF_NOAPPEND | RWF_ATOMIC \ + | RWF_DONTCACHE) /* Generic uio_lim.h does not define IOV_MAX. */ #ifndef IOV_MAX diff --git a/sysdeps/unix/sysv/linux/bits/uio-ext.h b/sysdeps/unix/sysv/linux/bits/uio-ext.h index 040cb8dd48..1b7ab4b495 100644 --- a/sysdeps/unix/sysv/linux/bits/uio-ext.h +++ b/sysdeps/unix/sysv/linux/bits/uio-ext.h @@ -50,6 +50,7 @@ extern ssize_t process_vm_writev (pid_t __pid, const struct iovec *__lvec, #define RWF_NOAPPEND 0x00000020 /* per-IO negation of O_APPEND */ #define RWF_ATOMIC 0x00000040 /* Write is to be issued with torn-write prevention. */ +#define RWF_DONTCACHE 0x00000080 /* Uncached buffered IO. */ __END_DECLS