]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
misc: Add support for Linux uio.h RWF_DONTCACHE flag
authorXi Ruoyao <xry111@xry111.site>
Thu, 28 Aug 2025 05:56:40 +0000 (13:56 +0800)
committerAdhemerval Zanella <adhemerval.zanella@linaro.org>
Mon, 8 Sep 2025 11:22:20 +0000 (08:22 -0300)
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 <xry111@xry111.site>
Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
manual/llio.texi
misc/tst-preadvwritev2-common.c
sysdeps/unix/sysv/linux/bits/uio-ext.h

index e7fd6ca0e9328205b9e9e5cbfb184588b8fce396..806ff0a27d5e0f05e861a032a9ed8e820931def4 100644 (file)
@@ -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
 
index ff1007d6d29a21de3d6f00a943ad01255cfc29eb..8a59ff2f9d0a7e79de8d30ca86a41e0acb634b89 100644 (file)
 #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
index 040cb8dd480bd460ed54d488273d4c1a44debad5..1b7ab4b49560e1de8506e84414fd9144e6fa58e2 100644 (file)
@@ -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