From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wm1-x336.google.com (mail-wm1-x336.google.com [IPv6:2a00:1450:4864:20::336]) by sourceware.org (Postfix) with ESMTPS id 9FE10384641C for ; Wed, 3 Apr 2024 06:17:33 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 9FE10384641C Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gmail.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 9FE10384641C Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2a00:1450:4864:20::336 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1712125056; cv=none; b=N9wlQckR2C7h49use2xvOBXn4Hqlrivg88UzzA4spqieFBfXWSI2TbUyp4r2YtNsLVkSyjRauxTd2sZm9fYni734mZp0t8GEYmLbmw5lphJkDh7f07sdWAg6uxmQxZPNR9xbtqV68qO20zseNp/6KYV7UbgO+l5TpBo/yA/BSHc= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1712125056; c=relaxed/simple; bh=u2ylJMKhcGantMIYOl0X77RtAA2T/k4+vZj2p++PVDg=; h=DKIM-Signature:Date:From:To:Subject:Message-ID:MIME-Version; b=roPpQ/z3iPpT3pvzWz1Z/SfF57EJaayR2MJsX5oKfg3llF8uRFeeaM5BF0T1HKt42NQOvbEsd6XKb2uIRXEaHMDTARofU+lueB5dUlY7ONo/KXcQTyKEv6uB26Il7NSUvY3FjsCzlbvEagXQn0jwSdcEButGA/Nb+SUpu1Q5M28= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by mail-wm1-x336.google.com with SMTP id 5b1f17b1804b1-415515178ceso31429205e9.0 for ; Tue, 02 Apr 2024 23:17:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1712125052; x=1712729852; darn=sourceware.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=TkxzjlLGbWevrC9TQw8ouXydIWfOTXPZMhEyLSNkHL8=; b=OVvBpSY7wp6VYfygLd9Oj1YnMg1epw2GpZzRpGhhvdz2D9giGjLKEOW8G46y4gqI0T nZE6++Wf+k52lDtb2xYhfaaxp8rnCgCot2xSSCCalZimzPJVYtCbai4eP9KAM3yrTJ0r iPsdMOs3M9p0V6K+DNtNiOSceqqCgukD9+zGwzZqIkmEYC/XqHRH5J5HHxCz/hwk1aX+ GyNYQRgL/psP8MaZxrTjJ5y7YOed+d1l5fsyaUlYsTjtdUT4lwXjLiFDN/SDasjl/XlE tH1OTpJGNOfNW5eYiggJaf76px0F5gn8fxjyy0TIYP+ud2OhlCX2zH70KN5d7yk5dJSV mBlw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1712125052; x=1712729852; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=TkxzjlLGbWevrC9TQw8ouXydIWfOTXPZMhEyLSNkHL8=; b=saofqLb0g9Tuu7rzkB7Vk4VlNUYrak/iqXPWCZnhQpTWgttVi43ZzoSnbwFkm4+qTu U7IOjM3Q7RIcShNugNVp/yfmMuTTVO6wz7UfZgXLZ/ADqE3h8PzJYxuvJ+zj+Dl/aOam 4TJXjlNwFBPc4q9Uri0oWFJ8COHEPw6qAtpfonI5ODavT79BiVo7fhUhD8s9r+JjLiA2 GvcB7wP3SE0SONKD4azL83ricZ+8W8+ZyAcHwR4/4s9a1aVf3kyuWREcHKEFEiiZj7At ayrmgNwHwQnBmCxgUgC4c8lqBUXYg7pWQiqmuqTaFqNTKdMU9FQf+OUCDJ7g6EkTjc0F kjPA== X-Gm-Message-State: AOJu0YwQeyMqZbgzGtxARc8exBBbkoiJUTbv7ColjG5c35LbygmDN4Wi u4z7VtCOITcAW35VyjzrKnX3qHIVzqpYQVi3rsUbTDMQsOmpDGjXpgIDpZ4mvkI= X-Google-Smtp-Source: AGHT+IFSmEbJN4vfTLG0+Vthv0hyVULpNzsYZbwcuSHicBNnzjbyfA7vJnpUyOJKZlHqgPF2l+6ZOg== X-Received: by 2002:a05:600c:1f84:b0:414:245:f6df with SMTP id je4-20020a05600c1f8400b004140245f6dfmr11411057wmb.21.1712125051271; Tue, 02 Apr 2024 23:17:31 -0700 (PDT) Received: from localhost (cpc1-brnt4-2-0-cust862.4-2.cable.virginm.net. [86.9.131.95]) by smtp.gmail.com with ESMTPSA id jg7-20020a05600ca00700b004161e19513bsm3202701wmb.19.2024.04.02.23.17.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 02 Apr 2024 23:17:30 -0700 (PDT) Date: Wed, 3 Apr 2024 07:17:29 +0100 From: Stafford Horne To: GLIBC patches Cc: Adhemerval Zanella Subject: Re: [PATCH] misc: Add support Linux uio.h RWF_NOAPPEND flag Message-ID: References: <20240403060437.3193600-1-shorne@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20240403060437.3193600-1-shorne@gmail.com> X-Spam-Status: No, score=-10.8 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,GIT_PATCH_0,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: Note, The subject should at least be "Add support *for* linux uio.h RWF_NOAPPEND flag" -Stafford On Wed, Apr 03, 2024 at 07:04:37AM +0100, Stafford Horne wrote: > 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 > > 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 >