From: Stafford Horne <shorne@gmail.com>
To: GLIBC patches <libc-alpha@sourceware.org>
Cc: Adhemerval Zanella <adhemerval.zanella@linaro.org>,
Stafford Horne <shorne@gmail.com>
Subject: [PATCH] misc: Add support Linux uio.h RWF_NOAPPEND flag
Date: Wed, 3 Apr 2024 07:04:37 +0100 [thread overview]
Message-ID: <20240403060437.3193600-1-shorne@gmail.com> (raw)
In Linux 6.9 a new flag is added to allow for Per-io operations to
disable append mode even if a file was opened with the flag O_APPEND.
This is done with the new RWF_NOAPPEND flag.
This caused two test failures as these tests expected the flag 0x00000020
to be unused. Adding the flag definition now fixes these tests on Linux
6.9 (v6.9-rc1).
FAIL: misc/tst-preadvwritev2
FAIL: misc/tst-preadvwritev64v2
This patch adds the flag, adjusts the test and adds details to
documentation.
Link: https://lore.kernel.org/all/20200831153207.GO3265@brightrain.aerifal.cx/
---
Cc: Adhemerval Zanella Netto <adhemerval.zanella@linaro.org>
As he mentioned he would be looking into it when this was mentioned in the
LoongArch TLS patch.
https://sourceware.org/pipermail/libc-alpha/2024-March/155323.html
This also was encountered during OpenRISC testing, and I found a fix. This has
been found before Linux 6.9 is actually released. I guess we should not merge
it to glibc until 6.9 is official. What is the policy on this?
manual/llio.texi | 5 +++++
misc/tst-preadvwritev2-common.c | 5 ++++-
sysdeps/unix/sysv/linux/bits/uio-ext.h | 1 +
3 files changed, 10 insertions(+), 1 deletion(-)
diff --git a/manual/llio.texi b/manual/llio.texi
index 0b61d491f5..e858e038ae 100644
--- a/manual/llio.texi
+++ b/manual/llio.texi
@@ -1341,6 +1341,11 @@ will fail and set @code{errno} to @code{EAGAIN} if the operation would block.
Per-IO synchronization as if the file was opened with @code{O_APPEND} flag.
@end vtable
+@item RWF_NOAPPEND
+This flag allows an offset to be honored, even if the file was opened with
+@code{O_APPEND} flag.
+@end vtable
+
When the source file is compiled with @code{_FILE_OFFSET_BITS == 64} the
@code{preadv2} function is in fact @code{preadv64v2} and the type
@code{off_t} has 64 bits, which makes it possible to handle files up to
diff --git a/misc/tst-preadvwritev2-common.c b/misc/tst-preadvwritev2-common.c
index b5f19f002c..8e04ff7282 100644
--- a/misc/tst-preadvwritev2-common.c
+++ b/misc/tst-preadvwritev2-common.c
@@ -34,8 +34,11 @@
#ifndef RWF_APPEND
# define RWF_APPEND 0
#endif
+#ifndef RWF_NOAPPEND
+# define RWF_NOAPPEND 0
+#endif
#define RWF_SUPPORTED (RWF_HIPRI | RWF_DSYNC | RWF_SYNC | RWF_NOWAIT \
- | RWF_APPEND)
+ | RWF_APPEND | RWF_NOAPPEND)
/* 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 7854cccef3..ead7a09156 100644
--- a/sysdeps/unix/sysv/linux/bits/uio-ext.h
+++ b/sysdeps/unix/sysv/linux/bits/uio-ext.h
@@ -47,6 +47,7 @@ extern ssize_t process_vm_writev (pid_t __pid, const struct iovec *__lvec,
#define RWF_SYNC 0x00000004 /* per-IO O_SYNC. */
#define RWF_NOWAIT 0x00000008 /* per-IO nonblocking mode. */
#define RWF_APPEND 0x00000010 /* per-IO O_APPEND. */
+#define RWF_NOAPPEND 0x00000020 /* per-IO negation of O_APPEND */
__END_DECLS
--
2.44.0
next reply other threads:[~2024-04-03 6:05 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-04-03 6:04 Stafford Horne [this message]
2024-04-03 6:17 ` [PATCH] misc: Add support Linux uio.h RWF_NOAPPEND flag Stafford Horne
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/libc/involved.html
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20240403060437.3193600-1-shorne@gmail.com \
--to=shorne@gmail.com \
--cc=adhemerval.zanella@linaro.org \
--cc=libc-alpha@sourceware.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).