From patchwork Wed Apr 3 07:13:54 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stafford Horne X-Patchwork-Id: 1919054 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20230601 header.b=g6EldjN0; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=sourceware.org (client-ip=2620:52:3:1:0:246e:9693:128c; helo=server2.sourceware.org; envelope-from=libc-alpha-bounces+incoming=patchwork.ozlabs.org@sourceware.org; receiver=patchwork.ozlabs.org) Received: from server2.sourceware.org (server2.sourceware.org [IPv6:2620:52:3:1:0:246e:9693:128c]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4V8bbH6tJ3z23tv for ; Wed, 3 Apr 2024 18:14:19 +1100 (AEDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 23A5D3846405 for ; Wed, 3 Apr 2024 07:14:18 +0000 (GMT) X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from mail-lj1-x229.google.com (mail-lj1-x229.google.com [IPv6:2a00:1450:4864:20::229]) by sourceware.org (Postfix) with ESMTPS id 0CC223847700 for ; Wed, 3 Apr 2024 07:14:02 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 0CC223847700 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 0CC223847700 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2a00:1450:4864:20::229 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1712128444; cv=none; b=eHbSF428tGyLVsAu5S7710pdKx01oQE3nSK8N1Cmq8DhhO7hkB1L6tSSl0c7mtvSXljACxdJsLXBd/53hrhi2g1wRkuU7ee26l70VxVK5A85Cpk1PDLjSJnFz9kn/EU1w007ziw2vkQCJPR+LtM16JgvVwYy8F+gXNi+qZdkwM4= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1712128444; c=relaxed/simple; bh=doXTU88JDpEFP5kEww5XZiX0GdGM/6PetCwIGOhPecw=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=cdXZuOXGxYfgFFmtL2f9hmo+69hdOBEacVaQY3R5Q12HTYl+LeQ6G8oZoGiwnTaNlROkVGDaRngrXibhIuw7Efd4uC6w51Z0z1IlFGd441k5L+3pfnnAQmR4KmWob2idqpeTvuDf9++Abwf6f7J1FcFN/ZtUIr8rNoI0SMdQ1jI= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by mail-lj1-x229.google.com with SMTP id 38308e7fff4ca-2d485886545so98962711fa.2 for ; Wed, 03 Apr 2024 00:14:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1712128439; x=1712733239; darn=sourceware.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=UZ+NiZVN/cMuxCmLSDAmXIGMGX9EGyvlqYPnnPjoSBA=; b=g6EldjN0tFKUpvWg5xbcEV/IXXtMe5ltiug9EPwR4b+mTDXWK9tacMQO8y9dL2Uwwa cZvl9lf+BeUbwPFQBHhmnFHCFLBaIs+Ms+22jbbheE2bgym8rP9uWpbR2utSs4uAQTfy uwoI475mNpkyNYnVVImMD/GLC/AvQcOAWkBweQ8qmfzFMvHLbhDHXj+yu+etnMGzAcMH PhXzcbksI1tHOeBaQexJlfHLEFlukgfZ/PvinqVhzRM2j+rp6WZGk59za+nXe0xDijUF arHbG9j1ZbaxlvDKtBfMYhLDuqp3WfHpq6KLOaEI+jpG/sriuPwBp2q89v3sEfyZzUSf 9e2w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1712128439; x=1712733239; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=UZ+NiZVN/cMuxCmLSDAmXIGMGX9EGyvlqYPnnPjoSBA=; b=txySKLNdjRKDrhzGRCBow9yxRs+mf8etL4k3S854CtBnxQIZRp7GYsXNQwLGXdW4Kn n9UEPdOAKrxzmNBxpQY46RzPPZxDSyLcALFdaHuHQpY7EWBnCNu4/GygxocqdFS/TgK4 lSGMag9vJw4gl4mGH86mkaXyKic73hWtzWYLog2PteRcOZW3R/4lalxHWmkZ9ThqrPoH NCPXw0+B/lZWBV9DzF11w6bWCWEmMPji9I0psjZgsPfdBHoiATsk5rNxouWok3RlLQVS W2cD6D7tp659S0yD1DwuKLMGvF5QDNznkKk7Hircru4RZxovLUXo+Oci5dBIkVTRgDxB nU7g== X-Gm-Message-State: AOJu0Yw2ke9ThWBgwfkodJAvGtTTonwzsOB/t0yNuRvCvMRE9MtLWvnL /gw7sijFKYNJEZDTOxmSwmQtCaJ2ioLzrf/RlKb1e5cutzP12GqhTkkqOPvYhgI= X-Google-Smtp-Source: AGHT+IHKKir64Q1bwNkivvW4plbbWbt9uUlMHnrXC2Y0DWZ63ANqqYDwK49Ev2OdzT1ijJobMFCAig== X-Received: by 2002:a05:651c:1692:b0:2d4:4ffa:9fa6 with SMTP id bd18-20020a05651c169200b002d44ffa9fa6mr2830515ljb.52.1712128439142; Wed, 03 Apr 2024 00:13:59 -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 g1-20020adfa481000000b00341e7e52802sm16454289wrb.92.2024.04.03.00.13.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 03 Apr 2024 00:13:58 -0700 (PDT) From: Stafford Horne To: GLIBC patches Cc: Adhemerval Zanella , Stafford Horne Subject: [PATCH v2] misc: Add support for Linux uio.h RWF_NOAPPEND flag Date: Wed, 3 Apr 2024 08:13:54 +0100 Message-ID: <20240403071354.3719942-1-shorne@gmail.com> X-Mailer: git-send-email 2.44.0 MIME-Version: 1.0 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 X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libc-alpha-bounces+incoming=patchwork.ozlabs.org@sourceware.org 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/ Reviewed-by: Adhemerval Zanella --- Since v1: - Fix subject grammar - Fix issue with build being broken due to having 2 @end vtable clauses in the .texi file. 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 | 4 ++++ misc/tst-preadvwritev2-common.c | 5 ++++- sysdeps/unix/sysv/linux/bits/uio-ext.h | 1 + 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/manual/llio.texi b/manual/llio.texi index 0b61d491f5..fae49d1433 100644 --- a/manual/llio.texi +++ b/manual/llio.texi @@ -1339,6 +1339,10 @@ will fail and set @code{errno} to @code{EAGAIN} if the operation would block. @item RWF_APPEND Per-IO synchronization as if the file was opened with @code{O_APPEND} flag. + +@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 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